예제 #1
0
 def test_uniqify_filename_uniqueness(self):
     """Test that uniqify_filename returns unique filenames"""
     # Confirm a list of 1000 uniquified filenames has 1000 unique results
     unique_filenames = [
         # pylint: disable=unused-variable
         uniqify_filename('hey.png') for x in range(0, 1000)
     ]
     self.assertEqual(len(set(unique_filenames)), 1000)
예제 #2
0
 def test_unique_filename_format(self):
     """Test that the format of the filename is correct"""
     # Confirm that the format of the filename is correct
     result = uniqify_filename('hey.png')
     self.assertTrue(
         re.search(
             r'^[0-9a-f]{32}\.png$',
             result
         )
     )