How to use groupy - 10 common examples

To help you get started, we’ve selected a few groupy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_nonstring_path_converted_to_string(self):
        url = endpoint.Endpoint.build_url(list())
        path = urlsplit(url).path
        self.assertEqual(path, '/[]')
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_multiple_string_args(self):
        url = endpoint.Endpoint.build_url('{}/{}', 'arg1', 'arg2')
        path = urlsplit(url).path
        self.assertEqual(path, '/arg1/arg2')
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_multiple_string_args_used_in_order_given(self):
        url = endpoint.Endpoint.build_url('{}/{}', 'arg2', 'arg1')
        path = urlsplit(url).path
        self.assertEqual(path, '/arg2/arg1')
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_extra_args_arg_ignored(self):
        url = endpoint.Endpoint.build_url('path', 1)
        path = urlsplit(url).path
        self.assertEqual(path, '/path')
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_one_numeric_arg(self):
        url = endpoint.Endpoint.build_url('{}', 1)
        path = urlsplit(url).path
        self.assertEqual(path, '/1')
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_one_string_arg(self):
        url = endpoint.Endpoint.build_url('{}', 'arg1')
        path = urlsplit(url).path
        self.assertEqual(path, '/arg1')
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_token_included_as_param(self):
        url = endpoint.Endpoint.build_url()
        params = urlsplit(url).query
        self.assertIn('token=TOKEN', params)
github rhgrant10 / Groupy / tests / test_endpoint.py View on Github external
def test_literal_path(self):
        url = endpoint.Endpoint.build_url('path')
        path = urlsplit(url).path
        self.assertEqual(path, '/path')
github rhgrant10 / Groupy / tests / test_pagers.py View on Github external
def setUp(self):
        self.m_manager = mock.Mock()
        self.m_endpoint = mock.Mock()
        pages = [
            [mock.Mock(id='foo'), mock.Mock(id='bar')],
            [mock.Mock(id='baz'), mock.Mock(id='qux')],
        ]
        self.m_endpoint.side_effect = pages
        self.messages = pagers.MessageList(self.m_manager, self.m_endpoint)
github rhgrant10 / Groupy / tests / test_utils.py View on Github external
def test_result_is_base_when_no_path(self):
        self.assertEqual(utils.urljoin(self.url), self.url)