Просмотр исходного кода

make basic test more robust

counting lines is a bad idea. just one unrelated output line and the test fails.
thus we rather check if what we expect is in the output.
Thomas Waldmann 10 лет назад
Родитель
Сommit
eb3bc1023b
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      borg/testsuite/archiver.py

+ 3 - 1
borg/testsuite/archiver.py

@@ -304,7 +304,9 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         self.cmd('create', '--stats', self.repository_location + '::test.2', 'input')
         self.cmd('create', '--stats', self.repository_location + '::test.2', 'input')
         with changedir('output'):
         with changedir('output'):
             self.cmd('extract', self.repository_location + '::test')
             self.cmd('extract', self.repository_location + '::test')
-        self.assert_equal(len(self.cmd('list', self.repository_location).splitlines()), 2)
+        list_output = self.cmd('list', self.repository_location)
+        self.assert_in('test ', list_output)
+        self.assert_in('test.2 ', list_output)
         expected =  [
         expected =  [
             'input',
             'input',
             'input/bdev',
             'input/bdev',