Example #1
0
 def test_clean_up(self):
     files = [
         "test_data_test_user.json",
         "test_data_todos.json",
         "test_data_users.json",
         "test_data_group.json",
         "test_data_group_user.json",
     ]
     for f in files:
         delete_file(f)
Example #2
0
 def test_delete_text_notfound_error(self):
     file_named = "error_file.txt"
     with pytest.raises(Exception):
         assert delete_file(file_named)
Example #3
0
 def test_delete_no_slash_two_error(self):
     file_named = r"/error_file.csv"
     with pytest.raises(Exception):
         result = delete_file(file_named)
         assert result is None
Example #4
0
 def test_delete_json_notfound_error(self):
     file_named = "error_file.json"
     with pytest.raises(FileNotFoundError):
         result = delete_file(file_named)
         assert result is None
Example #5
0
 def test_delete_type_error(self):
     file_named = ["test_sample.csv"]
     with pytest.raises(TypeError):
         result = delete_file(file_named)
         assert result is None
Example #6
0
 def test_delete_text_test_one(self):
     file_named = "test_1.html"
     result = delete_file(file_named)
     assert result == "complete"
Example #7
0
 def test_delete_json_test_sample(self):
     file_named = "test_sample.json"
     result = delete_file(file_named)
     assert result == "complete"
Example #8
0
 def test_delete_csv_test_sample(self):
     file_named = "test_sample.csv"
     result = delete_file(file_named)
     assert result == "complete"