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)
def go_delete(): file_name = [ "sample.csv", "sample.json", "test_1.html", "/test.csv", r"\error.json", ] for f in file_name: result = delete_file(f) print(result)
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
def test_delete_text_notfound_error(self): file_named = "error_file.txt" with pytest.raises(Exception): assert delete_file(file_named)
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
def test_delete_type_error(self): file_named = ["test_sample.csv"] with pytest.raises(TypeError): result = delete_file(file_named) assert result is None
def test_delete_text_test_one(self): file_named = "test_1.html" result = delete_file(file_named) assert result == "complete"
def test_delete_json_test_sample(self): file_named = "test_sample.json" result = delete_file(file_named) assert result == "complete"
def test_delete_csv_test_sample(self): file_named = "test_sample.csv" result = delete_file(file_named) assert result == "complete"
def test_delete_no_slash_error(self): file_named = r"\error_file.csv" with pytest.raises(Exception): assert delete_file(file_named)
def test_delete_type_error(self): file_named = ["test_sample.csv"] with pytest.raises(Exception): assert delete_file(file_named)