示例#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)