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']
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
def test_link_default_description(self): method = ('list_users', { 'path': '/users/', 'method': 'GET', }) link = decode._get_link_from_method(method)[-1] assert link.description == ''
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
def test_link_default_formats(self): method = ('list_users', { 'path': '/users/', 'method': 'GET', }) link = decode._get_link_from_method(method)[-1] assert link.formats == []
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
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'
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'
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']
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'
def test_link_url(self): method = ('list_users', {'path': '/users/', 'method': 'GET'}) link = decode._get_link_from_method(method)[-1] assert link.url == '/users/'
def test_link_element(self): method = ('list_users', {'path': '/users/', 'method': 'GET'}) result = decode._get_link_from_method(method) assert isinstance(result[-1], Link)
def test_action_element(self): method = ('list_users', {'path': '/users/', 'method': 'GET'}) result = decode._get_link_from_method(method) assert result[0] == 'list'
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)