1# Copyright (c) 2020, Manfred Moitzi
2# License: MIT License
3
4import pytest
5from ezdxf.lldxf.attributes import DXFAttr, RETURN_DEFAULT
6
7
8def test_return_default():
9    attr = DXFAttr(
10        code=62,
11        default=12,
12        validator=lambda x: False,
13        fixer=RETURN_DEFAULT,
14    )
15    assert attr.fixer(7) == 12
16
17    attr2 = DXFAttr(
18        code=63,
19        default=13,
20        validator=lambda x: False,
21        fixer=RETURN_DEFAULT,
22    )
23    assert attr2.fixer(7) == 13
24
25
26if __name__ == '__main__':
27    pytest.main([__file__])
28