Skip to content

Commit 70f57c6

Browse files
author
kbehrman
committed
added interface tests for client and module
1 parent d681560 commit 70f57c6

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

tests/test_client.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
class TestShotgunClient(base.MockTestBase):
2424
'''Test case for shotgun api with server interactions mocked.'''
25-
def __init__(self, *args, **kws):
26-
super(TestShotgunClient, self).__init__(*args, **kws)
2725

2826
def setUp(self):
2927
super(TestShotgunClient, self).setUp()
@@ -395,6 +393,28 @@ def test_thumb_url(self):
395393
self.assertRaises(RuntimeError, self.sg._build_thumb_url,
396394
"FakeAsset", 456)
397395

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+
398418

399419
if __name__ == '__main__':
400420
unittest.main()

0 commit comments

Comments
 (0)