|
22 | 22 |
|
23 | 23 | class TestShotgunClient(base.MockTestBase): |
24 | 24 | '''Test case for shotgun api with server interactions mocked.''' |
25 | | - def __init__(self, *args, **kws): |
26 | | - super(TestShotgunClient, self).__init__(*args, **kws) |
27 | 25 |
|
28 | 26 | def setUp(self): |
29 | 27 | super(TestShotgunClient, self).setUp() |
@@ -395,6 +393,28 @@ def test_thumb_url(self): |
395 | 393 | self.assertRaises(RuntimeError, self.sg._build_thumb_url, |
396 | 394 | "FakeAsset", 456) |
397 | 395 |
|
| 396 | +class TestShotgunClientInterface(base.MockTestBase): |
| 397 | + '''Tests expected interface for shotgun module and client''' |
| 398 | + def test_client_interface(self): |
| 399 | + expected_attributes = ['base_url', |
| 400 | + 'config', |
| 401 | + 'client_caps', |
| 402 | + 'server_caps'] |
| 403 | + for expected_attribute in expected_attributes: |
| 404 | + if not hasattr(self.sg, expected_attribute): |
| 405 | + assert False, '%s not found on %s' % (expected_attribute, |
| 406 | + self.sg) |
| 407 | + |
| 408 | + def test_module_interface(self): |
| 409 | + import shotgun_api3 |
| 410 | + expected_contents = ['Shotgun', 'ShotgunError', 'Fault', |
| 411 | + 'ProtocolError', 'ResponseError', 'Error', |
| 412 | + 'sg_timezone'] |
| 413 | + for expected_content in expected_contents: |
| 414 | + if not hasattr(shotgun_api3, expected_content): |
| 415 | + assert False, '%s not found on module %s' % (expected_content, |
| 416 | + shotgun_api3) |
| 417 | + |
398 | 418 |
|
399 | 419 | if __name__ == '__main__': |
400 | 420 | unittest.main() |
0 commit comments