-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DATAUP-497: Removing old code relating to the defunct UJS #2713
Merged
ialarmedalien
merged 1 commit into
DATAUP-497_job_comm_updates
from
DATAUP-497_ujs_py_cruft_removal
Jan 24, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from biokbase.workspace.client import Workspace | ||
from biokbase.narrative_method_store.client import NarrativeMethodStore | ||
from biokbase.userandjobstate.client import UserAndJobState | ||
from biokbase.catalog.Client import Catalog | ||
from biokbase.service.Client import Client as ServiceClient | ||
from biokbase.execution_engine2.execution_engine2Client import execution_engine2 | ||
|
@@ -19,21 +18,23 @@ def reset(): | |
def __init_client(client_name, token=None): | ||
if client_name == "workspace": | ||
c = Workspace(URLS.workspace, token=token) | ||
elif ( | ||
client_name == "execution_engine2" | ||
or client_name == "execution_engine" | ||
or client_name == "job_service" | ||
): | ||
elif client_name == "execution_engine2": | ||
c = execution_engine2(URLS.execution_engine2, token=token) | ||
elif client_name == "narrative_method_store": | ||
c = NarrativeMethodStore(URLS.narrative_method_store, token=token) | ||
elif client_name == "service" or client_name == "service_wizard": | ||
elif client_name == "service": | ||
c = ServiceClient(URLS.service_wizard, use_url_lookup=True, token=token) | ||
elif client_name == "catalog": | ||
c = Catalog(URLS.catalog, token=token) | ||
elif client_name == "user_and_job_state": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove -- unused |
||
c = UserAndJobState(URLS.user_and_job_state, token=token) | ||
else: | ||
raise ValueError('Unknown client name "%s"' % client_name) | ||
raise ValueError( | ||
'Unknown client name "%s"\n' % client_name | ||
+ "The following client names are recognised:\n" | ||
+ 'Catalog: "catalog"\n' | ||
+ 'Execution Engine 2: "execution_engine2"\n' | ||
+ 'NMS: "narrative_method_store"\n' | ||
+ 'Service Wizard: "service"\n' | ||
+ 'Workspace: "workspace"' | ||
) | ||
|
||
return c |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import unittest | ||
import biokbase.narrative.clients as clients | ||
|
||
from biokbase.workspace.client import Workspace as WS_Client | ||
from biokbase.narrative_method_store.client import NarrativeMethodStore as NMS_Client | ||
from biokbase.catalog.Client import Catalog as Catalog_Client | ||
from biokbase.service.Client import Client as Service_Client | ||
from biokbase.execution_engine2.execution_engine2Client import ( | ||
execution_engine2 as EE2_Client, | ||
) | ||
|
||
|
||
class ClientsTestCase(unittest.TestCase): | ||
def test_valid_clients(self): | ||
name_to_type = { | ||
"workspace": WS_Client, | ||
"execution_engine2": EE2_Client, | ||
"narrative_method_store": NMS_Client, | ||
"service": Service_Client, | ||
"catalog": Catalog_Client, | ||
} | ||
|
||
for client_name, client_type in name_to_type.items(): | ||
client = clients.get(client_name) | ||
self.assertIsInstance(client, client_type) | ||
|
||
def test_invalid_clients(self): | ||
invalid_names = ["service_wizard", "ee2", "ws"] | ||
|
||
for name in invalid_names: | ||
with self.assertRaisesRegex(ValueError, "Unknown client name"): | ||
clients.get(name) |
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
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all the synonyms as we only ever use
execution_engine2
in the codebase