Exemple #1
0
 def test_removes_all_blobs_with_mixed_parameters(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*(self.blob_keys + self.blob_uris + self.blob_infos))
     self.assertEqual(0, self.count_existing_files())
Exemple #2
0
 def test_removes_all_blobs_with_mixed_parameters_and_ignores_bad_values_with_ignore_errors(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*(self.blob_keys + self.blob_uris + self.blob_infos + range(5)), ignore_errors=True)
     self.assertEqual(0, self.count_existing_files())
Exemple #3
0
 def test_removes_all_blobs_by_key_string(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*[str(key) for key in self.blob_keys])
     self.assertEqual(0, self.count_existing_files())
Exemple #4
0
 def test_removes_all_blobs_by_info(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*self.blob_infos)
     self.assertEqual(0, self.count_existing_files())
Exemple #5
0
 def test_ignores_wrong_types_when_ignore_errors_passed(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*range(5), ignore_errors=True)
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
Exemple #6
0
 def test_removes_nothing_when_random_strings_are_passed(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*["Lobster ALL the fetish {0}".format(i) for i in range(10)])
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
Exemple #7
0
 def test_raises_when_passing_wrong_types(self):
     with self.assertRaises(TypeError):
         remove_files(*range(5))
Exemple #8
0
 def test_ignores_no_parameters_when_ignore_errors_passed(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(ignore_errors=True)
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
Exemple #9
0
 def test_raises_when_no_parameters_given(self):
     with self.assertRaises(ValueError):
         remove_files()
Exemple #10
0
 def test_ignores_wrong_kwargs_when_ignore_errors_passed(self):
     self.assertEqual(len(self.blob_keys), self.count_existing_files())
     remove_files(*self.blob_keys, ignore_errors=True, lobster='ALL the fetish!')
     self.assertEqual(0, self.count_existing_files())
Exemple #11
0
 def test_raises_when_passing_wrong_kwargs(self):
     with self.assertRaises(NameError):
         remove_files(*self.blob_keys, lobster='ALL the fetish!')