Esempio n. 1
0
def test_generate_classes(url_mock, api_spec_mock,
                          parse_mock, mock_swagger):
    api_spec_mock.return_value = {}
    mock_class_function = (lambda client, return_type: "return")
    parse_mock.return_value = {'class': mock_class_function}
    url_mock.return_value = MOCK_URL

    sc = ServiceClient(MOCK_SERVICE_ID)

    classes = sc.generate_classes()

    assert 'class' in classes
Esempio n. 2
0
def test_generate_classes(url_mock, api_spec_mock, parse_mock, mock_swagger):
    api_spec_mock.return_value = {}
    mock_class_function = (lambda client, return_type: "return")
    parse_mock.return_value = {'class': mock_class_function}
    url_mock.return_value = MOCK_URL

    sc = ServiceClient(MOCK_SERVICE_ID, root_path='/foo')

    classes = sc.generate_classes()
    parse_mock.assert_called_once_with(api_spec_mock.return_value,
                                       root_path='/foo')

    assert 'class' in classes