예제 #1
0
def test_import_project_good_url(mock_http_adapter: HttpInceptionAdapter,
                                 mock_io: IO, mock_http_response: Mock,
                                 serialized_project: dict):
    mock_http_response.json.return_value = {'body': serialized_project}
    mock_http_adapter.client.post.return_value = mock_http_response
    mock_http_adapter.import_project(mock_io)
    assert mock_http_adapter.client.post.call_args[0][0] == '/projects/import'
예제 #2
0
def test_import_project_returns_project(
        mock_http_adapter: HttpInceptionAdapter, mock_io: IO,
        mock_http_response: Mock, serialized_project: dict):
    mock_http_response.json.return_value = {'body': serialized_project}
    mock_http_adapter.client.post.return_value = mock_http_response
    project = mock_http_adapter.import_project(mock_io)
    assert isinstance(project, Project)