Beispiel #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']
Beispiel #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
Beispiel #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 == ''
Beispiel #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
Beispiel #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 == []
Beispiel #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
Beispiel #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'
Beispiel #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'
Beispiel #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']
Beispiel #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'
Beispiel #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/'
Beispiel #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)
Beispiel #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'
Beispiel #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)