-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[WIP] SA2.0, model/data-access edits, unit testing #17662
Closed
Closed
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8e59493
Initial data access testing infrastructure
jdavcs f4d34e5
Add first library data access tests
jdavcs e9b20fd
Add first user data access tests
jdavcs 2bcb5a4
Start replacing test_galaxy_mapping w/data access tests
jdavcs 6676b01
security.get_npns_roles: test + factor out
jdavcs 7062119
security.get_private_user_role: test + factor out
jdavcs f71ec6f
webapps.galaxy.services.user.get_users_for_index: test + factor out
jdavcs 3b4bbca
Move user data access method from webapps to managers
jdavcs cc382f2
More test-galaxy-mapping conversions
jdavcs 6430a11
Convert another test
jdavcs 79741f6
Convert test_ratings
jdavcs 1e343bb
Refactor model fixtures
jdavcs c645b3a
Drop test
jdavcs 9a0bf39
Drop test
jdavcs 3e147fc
Convert test_history_contents
jdavcs 07d4a42
Convert test_current_galaxy_sesssion
jdavcs 5831f4e
Convert hid tests
jdavcs a5fc071
Convert test_get_display_name
jdavcs 4884363
Drop test_tags
jdavcs 43486e3
Drop incomplete test
jdavcs 713ce55
Drop test_basic
jdavcs 873deec
Convert test_metadata_spec
jdavcs f4aef30
Drop unused fixture arg
jdavcs e44d866
Convert + improve test_job/task_metrics
jdavcs 847fef4
Drop test_tasks
jdavcs af7da08
Add test_history_update
jdavcs 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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from collections import namedtuple | ||
|
||
PRIVATE_OBJECT_STORE_ID = "my_private_data" | ||
|
||
MockTransaction = namedtuple("MockTransaction", "user") | ||
|
||
|
||
class MockObjectStore: | ||
|
||
def is_private(self, object): | ||
if object.object_store_id == PRIVATE_OBJECT_STORE_ID: | ||
return True | ||
else: | ||
return False | ||
|
||
|
||
def verify_items(items1, length, items2=None): | ||
assert len(items1) == length | ||
if items2: | ||
assert set(items2) == set(items1) |
Oops, something went wrong.
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.
This doesn't seem to belong in managers to me because it doesn't use trans or app. Also this code is only used in tests as far as I can grep - should just be moved to
galaxy.model.unittest_utils.model_testing_utils
or a new file likegalaxy.model.unittest_utils.helpers
. I think there is something jarring about seeing code like this mixed with app logic - I was immediately scared we were accessing data this way from the app.