Code Duplication    Length = 16-17 lines in 2 locations

yorm/tests/test_bases_mappable.py 2 locations

@@ 105-121 (lines=17) @@
102
          status: false
103
        """) == text
104
105
    def test_set(self):
106
        """Verify the file is written to after setting an attribute."""
107
        self.sample.var1 = "abc123"
108
        self.sample.var2 = 1
109
        self.sample.var3 = True
110
        self.sample.var4 = [42]
111
        self.sample.var5 = {'status': True}
112
        text = self.sample.__mapper__._read()
113
        assert strip("""
114
        var1: abc123
115
        var2: 1
116
        var3: true
117
        var4:
118
        - 42
119
        var5:
120
          status: true
121
        """) == text
122
123
    def test_set_converted(self):
124
        """Verify conversion occurs when setting attributes."""
@@ 123-138 (lines=16) @@
120
          status: true
121
        """) == text
122
123
    def test_set_converted(self):
124
        """Verify conversion occurs when setting attributes."""
125
        self.sample.var1 = 42
126
        self.sample.var2 = "1"
127
        self.sample.var3 = 'off'
128
        self.sample.var4 = None
129
        self.sample.var5 = {'status': 1}
130
        text = self.sample.__mapper__._read()
131
        assert strip("""
132
        var1: 42
133
        var2: 1
134
        var3: false
135
        var4: []
136
        var5:
137
          status: true
138
        """) == text
139
140
    def test_set_error(self):
141
        """Verify an exception is raised when a value cannot be converted."""