generated from NASA-PDS/template-repo-java
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to support issue #70: Add catching of warning exceptions from validate_osti_submission() when site_url is not online, comment out function to write output file from draft_test.py since it is not needed, fix bug with draft_test.py to use force=True instead of force_flag=True, fix bug with release_test.py by removing existing temporary database at initial run, fix bug with reserve_test.py to use force=True instead of force_flag=True, add SiteURNotExistException to exceptions.py, fix bug with fromisoformat() since Python version on linux is 3.68 and does not support it, add error handling of publication_date, add verification of site_url being online or not in doi_validator.py. Changes responding to first set of comments for pull request of issue #70: Add handling when a connection can be made to the server but the page does not exist, add _check_field_site_url() check for all actions and not just 'release'. change warning message
- Loading branch information
Qui T Chau
authored and
thomas loubrieu
committed
Sep 29, 2020
1 parent
8014621
commit 9c6bcf4
Showing
7 changed files
with
119 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,14 @@ class MyTestCase(unittest.TestCase): | |
# to demonstrate that they have new status of 'Pending' or 'Registered'. If for some reason the server has been wiped clean, this unit test will still run | ||
# but won't show any status changed to 'Registered'. | ||
# | ||
# Because validation has been added to each action, the force_flag=True is required as the command line is not parsed for unit test. | ||
# Because validation has been added to each action, the force=True is required as the command line is not parsed for unit test. | ||
|
||
db_name = 'doi_temp.db' | ||
logger.info("Creating test artifact database file {self.db_name}") | ||
# Remove db_name if exist to have a fresh start otherwise exception will be raised about using existing lidvid. | ||
if os.path.isfile(db_name): | ||
os.remove(db_name) | ||
logger.info(f"Removed test artifact database file {db_name}") | ||
|
||
# Release some DOIs. | ||
# Move instantation of DOICoreActionRelease() object inside tests since the temporary file is removed after each test | ||
|
@@ -39,7 +43,7 @@ def test_reserve(self): | |
# Instantiate DOICoreActionRelease() here so a new database file is created and removed for each test. | ||
# The setUp() function is called per test. | ||
logger.info("test release of document from 'reserve' action. This test would only work if the authentication for OSTI has been set up and DOIs exist.") | ||
result_list = self._action.run(input='input/DOI_Release_20200727_from_reserve.xml',node='img',submitter='[email protected]',force_flag=True) | ||
result_list = self._action.run(input='input/DOI_Release_20200727_from_reserve.xml',node='img',submitter='[email protected]',force=True) | ||
|
||
logger.info(result_list) | ||
# The tearDown() function is called per test. | ||
|
@@ -49,7 +53,7 @@ def test_draft(self): | |
# The setUp() function is called per test. | ||
logger.info("test release of document from 'release' output. This test would only work if the authentication for OSTI has been set up and DOIs exist.") | ||
result_list = [] | ||
result_list = self._action.run(input='input/DOI_Release_20200727_from_draft.xml',node='img',submitter='[email protected]',force_flag=True) | ||
result_list = self._action.run(input='input/DOI_Release_20200727_from_draft.xml',node='img',submitter='[email protected]',force=True) | ||
|
||
logger.info(result_list) | ||
# The tearDown() function is called per test. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters