Commit d45398cb authored by Vuillaume's avatar Vuillaume Committed by Enrique Garcia
Browse files

more complete printed info

parent 4027fbf8
...@@ -249,8 +249,7 @@ class ZenodoAPI: ...@@ -249,8 +249,7 @@ class ZenodoAPI:
if self.exist_zenodo_metadata_file: if self.exist_zenodo_metadata_file:
print("\n * Using the .zenodo.json file to simulate a new upload to Zenodo... \n") print("\n * Using the .zenodo.json file to simulate a new upload to Zenodo... \n")
else: else:
print("\n ! Creating a .zenodo.json file from your codemeta.json file...\n" print("\n ! Creating a .zenodo.json file from your codemeta.json file... \n")
" Please add, commit and push this file to your project repository.")
self.path_zenodo_metadata_file = self.path_codemeta_file.parent / '.zenodo.json' self.path_zenodo_metadata_file = self.path_codemeta_file.parent / '.zenodo.json'
parse_codemeta_and_write_zenodo_metadata_file(self.path_codemeta_file, parse_codemeta_and_write_zenodo_metadata_file(self.path_codemeta_file,
...@@ -260,17 +259,17 @@ class ZenodoAPI: ...@@ -260,17 +259,17 @@ class ZenodoAPI:
print("Testing communication with Zenodo...") print("Testing communication with Zenodo...")
test_connection = self.fetch_user_entries() test_connection = self.fetch_user_entries()
if test_connection.status_code == 200: if test_connection.status_code == 200:
print("OK !") print("Test connection status OK !")
else: else:
print(test_connection.json()) print("ERROR while testing connection status\n", test_connection.json())
# 2 - Test new entry # 2 - Test new entry
print("Testing the creation of a dummy entry to (sandbox)Zenodo...") print("Testing the creation of a dummy entry to (sandbox)Zenodo...")
new_entry = self.create_new_entry() new_entry = self.create_new_entry()
if new_entry.status_code == 201: if new_entry.status_code == 201:
print("OK !") print("Test new entry status OK !")
else: else:
print(new_entry.json()) print("ERROR while testing the creation of new entry\n", new_entry.json())
# 3 - Test upload metadata # 3 - Test upload metadata
print("Testing the ingestion of the Zenodo metadata...") print("Testing the ingestion of the Zenodo metadata...")
...@@ -283,17 +282,17 @@ class ZenodoAPI: ...@@ -283,17 +282,17 @@ class ZenodoAPI:
data=metadata_entry data=metadata_entry
) )
if update_metadata.status_code == 200: if update_metadata.status_code == 200:
print("OK !") print("Update metadata status OK !")
else: else:
print(update_metadata.json()) print("ERROR while testing update of metadata\n", update_metadata.json())
# 4 - Test delete entry # 4 - Test delete entry
print("Testing the deletion of the dummy entry...") print("Testing the deletion of the dummy entry...")
delete_test_entry = self.erase_entry(test_entry_id) delete_test_entry = self.erase_entry(test_entry_id)
if delete_test_entry.status_code == 204: if delete_test_entry.status_code == 204:
print("OK !") print("Delete test entry status OK !")
else: else:
print(delete_test_entry.json()) print("ERROR while deleting test entry\n", delete_test_entry.json())
print("\n\tYAY ! Successful testing of the connection to Zenodo ! \n\n" print("\n\tYAY ! Successful testing of the connection to Zenodo ! \n\n"
"You should not face any trouble when uploading a project to Zenodo through the " "You should not face any trouble when uploading a project to Zenodo through the "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment