Code Duplication    Length = 9-9 lines in 2 locations

tests/test_add.py 2 locations

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