def test_delete_root_directory(self, test_client):
     directory_to_delete = "./"
     response = test_client.delete(
         '/path/{}'.format(directory_to_delete),
         headers={"apiKey": standard_user().api_key})
     assert (os.path.exists(
         app.config['DATA_DIRECTORY'])) and response.status_code == 403
 def test_delete_empty_directory(self, test_client):
     directory_to_delete = "{}/empty_dir".format(standard_user().username)
     response = test_client.delete(
         '/path/{}'.format(directory_to_delete),
         headers={"apiKey": standard_user().api_key})
     assert (not os.path.exists(
         os.path.join(app.config['DATA_DIRECTORY'], directory_to_delete))
             and response.status_code == 204)
 def test_delete_single_file(self, test_client):
     file_to_delete = "{}/file.json".format(standard_user().username)
     response = test_client.delete(
         '/path/{}'.format(file_to_delete),
         headers={"apiKey": standard_user().api_key})
     assert (not os.path.exists(
         os.path.join(app.config['DATA_DIRECTORY'], file_to_delete))
             and response.status_code == 204)
 def test_delete_invalid_file(self, test_client):
     file_to_delete = "{}/does_not_exist".format(standard_user().username)
     response = test_client.delete(
         '/path/{}'.format(file_to_delete),
         headers={"apiKey": standard_user().api_key})
     assert response.status_code == 400