-
Notifications
You must be signed in to change notification settings - Fork 202
Ticket/28817 fix api tests for new features #82
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
Merged
nemoDreamer
merged 3 commits into
master
from
ticket/28817_fix_api_tests_for_new_features
Mar 25, 2015
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -105,35 +105,38 @@ def test_schema(self): | |
self.assertTrue(ret_val) | ||
|
||
def test_schema_with_project(self): | ||
"""Called schema functions""" | ||
"""Called schema functions with project""" | ||
|
||
project_entity = {'type': 'Project', 'id': 0} | ||
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. @manneohrstrom, I kept this definition outside of the 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. looks much nicer than my code! |
||
|
||
if not self.sg.server_caps.version or self.sg.server_caps.version < (5, 4, 4): | ||
|
||
# server does not support this! | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_entity_read, {'type': 'Project', 'id': 0}) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_read, {'type': 'Project', 'id': 0}) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_field_read, 'Version', None, {'type': 'Project', 'id': 0}) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_field_read, 'Version', 'user', {'type': 'Project', 'id': 0}) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_entity_read, project_entity) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_read, project_entity) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_field_read, 'Version', None, project_entity) | ||
self.assertRaises(shotgun_api3.ShotgunError, self.sg.schema_field_read, 'Version', 'user', project_entity) | ||
|
||
else: | ||
project_entity = {'type': 'Project', 'id': 0} | ||
|
||
schema = self.sg.schema_entity_read(project_entity) | ||
self.assertTrue(schema, dict) | ||
self.assertTrue(len(schema) > 0) | ||
self.assertTrue('Project' in schema) | ||
self.assertTrue('visible' in schema['Project']) | ||
|
||
schema = self.sg.schema_read(project_entity) | ||
self.assertTrue(schema, dict) | ||
self.assertTrue(len(schema) > 0) | ||
self.assertTrue('Version' in schema) | ||
self.assertFalse('visible' in schema.keys()) | ||
|
||
schema = self.sg.schema_field_read('Version', project_entity=project_entity) | ||
self.assertTrue(schema, dict) | ||
self.assertTrue(len(schema) > 0) | ||
self.assertTrue('user' in schema) | ||
self.assertTrue('visible' in schema['user']) | ||
|
||
schema = self.sg.schema_field_read('Version', 'user', project_entity) | ||
self.assertTrue(schema, dict) | ||
self.assertTrue(len(schema) > 0) | ||
|
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.
@manneohrstrom, I'd been tasked w/ fixing this, and only saw much later that you'd fixed the
project
aspect of this...So this is the conflict resolution, I hope you don't mind I kept "mine", since I'd already cherry-picked my
ensure_...
changes over from #79...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.
No worries at all - this was just a quick fix to get the tests working on older servers. Looks like you have done a much more holistic pass, trying to clean things up properly (which is totally awesome!). So please ignore/discard any of my changes in favour of your proper changes. This was just a quick fix to make sure we can release the API with all tests passing.