예제 #1
0
 def test_file(self):
     possible_chars = (string.ascii_letters + string.digits +
                       '!@#$%^&*()_-~`"\',.<>?:;|[]{}')
     for i in range(100):
         new_str = random_pathname_replacement('foobar')
         for c in list(new_str):
             self.assertIn(c, possible_chars)
예제 #2
0
 def test_path(self):
     possible_chars = (string.ascii_letters + string.digits +
                       '!@#$%^&*()_-~`"\',.<>?:;|[]{}')
     for i in range(100):
         new_str = random_pathname_replacement('/foo/bar')
         self.assertIn(new_str[0], '/')
         self.assertIn(new_str[1], possible_chars)
         self.assertIn(new_str[2], possible_chars)
         self.assertIn(new_str[3], possible_chars)
         self.assertIn(new_str[4], '/')
         self.assertIn(new_str[5], possible_chars)
         self.assertIn(new_str[6], possible_chars)
         self.assertIn(new_str[7], possible_chars)
예제 #3
0
 def test_root(self):
     new_str = random_pathname_replacement('/')
     self.assertEqual(new_str, '/')