Browse Source

test: add test for --fix-filenames

tags/0.2.0
Matteo Cypriani 1 year ago
parent
commit
93c37d756d
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      test/test_gcp.py

+ 13
- 0
test/test_gcp.py View File

@@ -239,6 +239,19 @@ class TestCopyCases(unittest.TestCase):
check_after = dirCheck('.')
self.assertEqual(check_before, check_after)

def test_fix_filenames(self):
"""Checks the --fix-filenames option.
"""
source = 'wi||fat<like>this:"file*name"?'
fixed_name = 'wi!!fat[like]this;\'file+name\'_'
makeRandomFile(source, S10K)
source_sha = sha1sum(source)
mkdir('dest_dir')
ret = system(GCP + " --fix-filenames=force '" + source + "' dest_dir")
self.assertNotEqual(ret, 0)
dest = join('dest_dir', fixed_name)
dest_sha = sha1sum(dest)
self.assertEqual(source_sha, dest_sha)

if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save