Code Duplication    Length = 26-26 lines in 2 locations

tests/test_examples.py 1 location

@@ 45-70 (lines=26) @@
42
        return "<standard {}>".format(id(self))
43
44
45
@yorm.attr(array=IntegerList)
46
@yorm.attr(falsey=Boolean)
47
@yorm.attr(number_int=Integer)
48
@yorm.attr(number_real=Float)
49
@yorm.attr(object=EmptyDictionary)
50
@yorm.attr(string=String)
51
@yorm.attr(truthy=Boolean)
52
@yorm.sync("path/to/{self.category}/{self.name}.yml")
53
class SampleStandardDecorated:
54
    """Sample class using standard attribute types."""
55
56
    def __init__(self, name, category='default'):
57
        self.name = name
58
        self.category = category
59
        # https://docs.python.org/3.4/library/json.html#json.JSONDecoder
60
        self.object = {}
61
        self.array = []
62
        self.string = ""
63
        self.number_int = 0
64
        self.number_real = 0.0
65
        self.truthy = True
66
        self.falsey = False
67
        self.null = None
68
69
    def __repr__(self):
70
        return "<decorated {}>".format(id(self))
71
72
73
@yorm.attr(label=String)

tests/test_files.py 1 location

@@ 27-52 (lines=26) @@
24
    """Sample list container."""
25
26
27
@yorm.attr(array=IntegerList)
28
@yorm.attr(false=Boolean)
29
@yorm.attr(number_int=Integer)
30
@yorm.attr(number_real=Float)
31
@yorm.attr(object=EmptyDictionary)
32
@yorm.attr(string=String)
33
@yorm.attr(true=Boolean)
34
@yorm.sync("path/to/{self.category}/{self.name}.yml")
35
class SampleStandardDecorated:
36
    """Sample class using standard attribute types."""
37
38
    def __init__(self, name, category='default'):
39
        self.name = name
40
        self.category = category
41
        # https://docs.python.org/3.4/library/json.html#json.JSONDecoder
42
        self.object = {}
43
        self.array = []
44
        self.string = ""
45
        self.number_int = 0
46
        self.number_real = 0.0
47
        self.true = True
48
        self.false = False
49
        self.null = None
50
51
    def __repr__(self):
52
        return "<decorated {}>".format(id(self))
53
54
55
# TESTS ########################################################################