Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 203
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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} | ||
ContributorAuthor 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 Contributor 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) | ||
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
projectaspect 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.