コード例 #1
0
 def test_keys_element_complex_method(self):
     method = ('list_users_groups', {
         'path': '/users/{}/groups/',
         'method': 'GET'
     })
     result = decode._get_link_from_method(method)
     assert result[1] == ['users', 'groups']
コード例 #2
0
 def test_number_of_elements_in_tuple_complex_method(self):
     method = ('list_users_groups', {
         'path': '/users/{}/groups/',
         'method': 'GET'
     })
     result = decode._get_link_from_method(method)
     assert len(result) == 3
コード例 #3
0
 def test_link_default_description(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
     })
     link = decode._get_link_from_method(method)[-1]
     assert link.description == ''
コード例 #4
0
 def test_link_fields(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
     })
     link = decode._get_link_from_method(method)[-1]
     assert len(link.fields) == 0
コード例 #5
0
 def test_link_default_formats(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
     })
     link = decode._get_link_from_method(method)[-1]
     assert link.formats == []
コード例 #6
0
 def test_link_default_authentication(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
     })
     link = decode._get_link_from_method(method)[-1]
     assert not link.authentication
コード例 #7
0
 def test_link_default_title(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
     })
     link = decode._get_link_from_method(method)[-1]
     assert link.title == 'List users'
コード例 #8
0
 def test_link_description(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
         'documentation': 'Blabla'
     })
     link = decode._get_link_from_method(method)[-1]
     assert link.description == 'Blabla'
コード例 #9
0
 def test_link_formats(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
         'formats': ['xml', 'json']
     })
     link = decode._get_link_from_method(method)[-1]
     assert link.formats == ['xml', 'json']
コード例 #10
0
 def test_link_title(self):
     method = ('list_users', {
         'path': '/users/',
         'method': 'GET',
         'description': 'List users from app'
     })
     link = decode._get_link_from_method(method)[-1]
     assert link.title == 'List users from app'
コード例 #11
0
 def test_link_url(self):
     method = ('list_users', {'path': '/users/', 'method': 'GET'})
     link = decode._get_link_from_method(method)[-1]
     assert link.url == '/users/'
コード例 #12
0
 def test_link_element(self):
     method = ('list_users', {'path': '/users/', 'method': 'GET'})
     result = decode._get_link_from_method(method)
     assert isinstance(result[-1], Link)
コード例 #13
0
 def test_action_element(self):
     method = ('list_users', {'path': '/users/', 'method': 'GET'})
     result = decode._get_link_from_method(method)
     assert result[0] == 'list'
コード例 #14
0
 def test_return_type_from_getting_link_method(self):
     method = ('list_users', {'path': '/users/', 'method': 'GET'})
     result = decode._get_link_from_method(method)
     assert isinstance(result, tuple)