Code Duplication    Length = 9-9 lines in 2 locations

tests/test_add.py 2 locations

@@ 136-144 (lines=9) @@
133
        image = self.add('p/afile.f')
134
        series.mergeWith.assert_called_with(self.img)
135
        self.repo.update.assert_any_call(series)
136
137
    def test_If_file_not_version_but_series_has_file(self):               # D2
138
        series = Mock()
139
        series.hasFile.return_value = True
140
        self.repo.byLocation.return_value = None
141
        self.repo.getSeries.return_value = series
142
        image = self.add('p/afile.f')
143
        assert not series.mergeWith.called
144
        self.img.keepVersionsFromPrevious.assert_called_with(series)
145
        self.repo.update.assert_any_call(self.img)
146
147
    def test_copiesOf_not_called_before_inspect(self):
@@ 126-134 (lines=9) @@
123
        image = self.add('p/afile.f')
124
        self.img.keepVersionsFromPrevious.assert_called_with(previousVersion)
125
        self.repo.update.assert_any_call(self.img)
126
127
    def test_If_file_not_version_but_series_and_not_in_there_yet(self):   # D1
128
        series = Mock()
129
        series.hasFile.return_value = False
130
        series.mergeWith.return_value = series
131
        self.repo.byLocation.return_value = None
132
        self.repo.getSeries.return_value = series
133
        image = self.add('p/afile.f')
134
        series.mergeWith.assert_called_with(self.img)
135
        self.repo.update.assert_any_call(series)
136
137
    def test_If_file_not_version_but_series_has_file(self):               # D2