-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
102 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ def test_job_context_discover_outputs_flushes_once(mocker): | |
sa_session = app.model.context | ||
# mocker is a pytest-mock fixture | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
h = model.History(name="Test History", user=u) | ||
|
||
tool = Tool(app) | ||
|
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 |
---|---|---|
|
@@ -57,7 +57,7 @@ def test_hda_security(self, tmp_path): | |
permissions = {access_action: [private_role], manage_action: [private_role]} | ||
security_agent.set_all_dataset_permissions(hda.dataset, permissions) | ||
|
||
other_user = model.User(email="[email protected]", password="mockpass2") | ||
other_user = model.User(email="[email protected]", password="mockpass2", username="otheruser") | ||
self._commit_objects([other_user]) | ||
security_agent = self.app.security_agent | ||
email_path = self.email_path | ||
|
@@ -125,7 +125,7 @@ def test_no_redact_user_details_in_bugreport(self, tmp_path): | |
) | ||
|
||
def _setup_model_objects(self): | ||
user = model.User(email=TEST_USER_EMAIL, password="mockpass") | ||
user = model.User(email=TEST_USER_EMAIL, password="mockpass", username=TEST_USER_EMAIL.split("@")[0]) | ||
job = model.Job() | ||
job.tool_id = "cat1" | ||
job.history = model.History() | ||
|
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 |
---|---|---|
|
@@ -36,7 +36,7 @@ def t_data_path(name): | |
def _run_jihaw_cleanup(archive_dir, app=None): | ||
app = app or _mock_app() | ||
job = model.Job() | ||
job.user = model.User(email="[email protected]", password="test") | ||
job.user = model.User(email="[email protected]", password="test", username="test") | ||
job.tool_stderr = "" | ||
jiha = model.JobImportHistoryArchive(job=job, archive_dir=archive_dir) | ||
app.model.context.current.add_all([job, jiha]) | ||
|
@@ -661,7 +661,7 @@ def _setup_history_for_export(history_name): | |
sa_session = app.model.context | ||
|
||
email = history_name.replace(" ", "-") + "[email protected]" | ||
u = model.User(email=email, password="password") | ||
u = model.User(email=email, password="password", username=email.split("@")[0]) | ||
h = model.History(name=history_name, user=u) | ||
|
||
return app, sa_session, h | ||
|
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 |
---|---|---|
|
@@ -356,9 +356,7 @@ def __test_workflow(self): | |
workflow = model.Workflow() | ||
workflow.stored_workflow = stored_workflow | ||
stored_workflow.latest_workflow = workflow | ||
user = model.User() | ||
user.email = "[email protected]" | ||
user.password = "passw0rD1" | ||
user = model.User(email="[email protected]", password="passw0rD1", username="test") | ||
stored_workflow.user = user | ||
self.app.model.context.add(workflow) | ||
self.app.model.context.add(stored_workflow) | ||
|
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 |
---|---|---|
|
@@ -225,7 +225,7 @@ def _import_library_target(target, work_directory): | |
with store.DirectoryModelExportStore(temp_directory, app=app, serialize_dataset_objects=True) as export_store: | ||
persist_target_to_export_store(target, export_store, app.object_store, work_directory) | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="library") | ||
|
||
import_options = store.ImportOptions(allow_dataset_object_edit=True, allow_library_creation=True) | ||
import_model_store = store.get_import_model_store_for_directory( | ||
|
@@ -240,7 +240,7 @@ def _import_library_target(target, work_directory): | |
def _import_directory_to_history(app, target, work_directory): | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
import_history = model.History(name="Test History for Import", user=u) | ||
|
||
sa_session = app.model.context | ||
|
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 |
---|---|---|
|
@@ -312,7 +312,7 @@ def test_import_library_require_permissions(): | |
app = _mock_app() | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
|
||
library = model.Library(name="my library 1", description="my library description", synopsis="my synopsis") | ||
root_folder = model.LibraryFolder(name="my library 1", description="folder description") | ||
|
@@ -340,7 +340,7 @@ def test_import_export_library(): | |
app = _mock_app() | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
|
||
library = model.Library(name="my library 1", description="my library description", synopsis="my synopsis") | ||
root_folder = model.LibraryFolder(name="my library 1", description="folder description") | ||
|
@@ -684,7 +684,7 @@ def test_import_export_edit_collection(): | |
app = _mock_app() | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
h = model.History(name="Test History", user=u) | ||
|
||
c1 = model.DatasetCollection(collection_type="list", populated=False) | ||
|
@@ -761,7 +761,7 @@ def test_import_export_composite_datasets(): | |
app = _mock_app() | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
h = model.History(name="Test History", user=u) | ||
|
||
d1 = _create_datasets(sa_session, h, 1, extension="html")[0] | ||
|
@@ -804,7 +804,7 @@ def test_edit_metadata_files(): | |
app = _mock_app(store_by="uuid") | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
h = model.History(name="Test History", user=u) | ||
|
||
d1 = _create_datasets(sa_session, h, 1, extension="bam")[0] | ||
|
@@ -910,7 +910,7 @@ def _assert_simple_cat_job_imported(imported_history, state="ok"): | |
def _setup_simple_cat_job(app, state="ok"): | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
h = model.History(name="Test History", user=u) | ||
|
||
d1, d2 = _create_datasets(sa_session, h, 2) | ||
|
@@ -966,7 +966,7 @@ def _setup_invocation(app): | |
def _setup_simple_collection_job(app, state="ok"): | ||
sa_session = app.model.context | ||
|
||
u = model.User(email="[email protected]", password="password") | ||
u = model.User(email="[email protected]", password="password", username="collection") | ||
h = model.History(name="Test History", user=u) | ||
|
||
d1, d2, d3, d4 = _create_datasets(sa_session, h, 4) | ||
|
@@ -1170,7 +1170,7 @@ def setup_fixture_context_with_user( | |
) -> StoreFixtureContextWithUser: | ||
app = _mock_app(store_by=store_by) | ||
sa_session = app.model.context | ||
user = model.User(email=user_email, password="password") | ||
user = model.User(email=user_email, password="password", username=user_email.split("@")[0]) | ||
return StoreFixtureContextWithUser(app=app, sa_session=sa_session, user=user) | ||
|
||
|
||
|
Oops, something went wrong.