Skip to content

Commit

Permalink
[WIP] Start on unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rotty committed Jun 19, 2015
1 parent bbb53e5 commit 1f4277e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions attic/testsuite/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,23 @@ def test_exclude_caches(self):
self.assert_equal(sorted(os.listdir('output/input')), ['cache2', 'file1'])
self.assert_equal(sorted(os.listdir('output/input/cache2')), ['CACHEDIR.TAG'])

def test_files_from(self):
self._test_files_from_option(self, delim='\n', option='--files-from')

def test_files_from0(self):
self._test_files_from_option(self, delim='\0', option='--files-from0')

def _test_files_from_option(self, *, delim, option):
self.attic('init', self.repository_location)
for filename in ['file1', 'non-listed/file', 'listed/file']:
self.create_regular_file(filename, size=1024 * 80)
listed_files = sorted(['file1', 'listed/file'])
self.create_regular_file('filelist', contents=delim.join(listed_files))
self.attic('create', option + '=filelist', self.repository_location + '::test')
with changedir('output'):
self.attic('extract', self.repository_location + '::test')
self.assert_equal(sorted(os.listdir('output/input'), listed_files))

def test_path_normalization(self):
self.attic('init', self.repository_location)
self.create_regular_file('dir1/dir2/file', size=1024 * 80)
Expand Down

0 comments on commit 1f4277e

Please sign in to comment.