Ver código fonte

test: add test for --fix-filenames

Matteo Cypriani 6 meses atrás
pai
commit
93c37d756d
1 arquivos alterados com 13 adições e 0 exclusões
  1. 13
    0
      test/test_gcp.py

+ 13
- 0
test/test_gcp.py Ver arquivo

@@ -239,6 +239,19 @@ class TestCopyCases(unittest.TestCase):
239 239
         check_after = dirCheck('.')
240 240
         self.assertEqual(check_before, check_after)
241 241
 
242
+    def test_fix_filenames(self):
243
+        """Checks the --fix-filenames option.
244
+        """
245
+        source = 'wi||fat<like>this:"file*name"?'
246
+        fixed_name = 'wi!!fat[like]this;\'file+name\'_'
247
+        makeRandomFile(source, S10K)
248
+        source_sha = sha1sum(source)
249
+        mkdir('dest_dir')
250
+        ret = system(GCP + " --fix-filenames=force '" + source + "' dest_dir")
251
+        self.assertNotEqual(ret, 0)
252
+        dest = join('dest_dir', fixed_name)
253
+        dest_sha = sha1sum(dest)
254
+        self.assertEqual(source_sha, dest_sha)
242 255
 
243 256
 if __name__ == '__main__':
244 257
     unittest.main()

Carregando…
Cancelar
Salvar