def test_no_replacement(self): """ Will not make any replacements if not configured to. """ igdi = InstrumentedGitDiffIndex(self.testrepo, self.testdiffs[0]) filenames = [i['filename'] for i in igdi.files()] self.assertEqual(1, len(filenames)) self.assertEqual('{0}/argument.txt'.format(self.testrepodir), filenames[0])
def test_will_replace(self): """ Will replace part of the filename path with something else. """ igdi = InstrumentedGitDiffIndex(self.testrepo, self.testdiffs[0]) igdi.replace_path = (self.testrepodir, '/path') filenames = [i['filename'] for i in igdi.files()] self.assertEqual(1, len(filenames)) self.assertEqual('/path/argument.txt', filenames[0])
def test_no_replacement(self): """ Will not make any replacements if not configured to. """ igdi = InstrumentedGitDiffIndex(self.testrepo, self.testdiffs[0]) filenames = [i['filename'] for i in igdi.files()] self.assertEqual(1, len(filenames)) self.assertEqual( '{0}/argument.txt'.format(self.testrepodir), filenames[0])
def test_will_replace(self): """ Will replace part of the filename path with something else. """ igdi = InstrumentedGitDiffIndex(self.testrepo, self.testdiffs[0]) igdi.replace_path = (self.testrepodir, '/path') filenames = [i['filename'] for i in igdi.files()] self.assertEqual(1, len(filenames)) self.assertEqual( '/path/argument.txt', filenames[0])