Skip to content

Conversation

@shaswat91
Copy link
Contributor

No description provided.

Copy link
Contributor

@waynew waynew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will definitely need to do a more in-depth review, along with building some sample module.run states to run against this, but at the very least the unit tests need some upgrades, and integration tests are also a requirement.

@patch.object(nsxt_request, "call_api")
def test_get_using_basic_auth(mock_call_api):

mock_call_api.return_value = _mock_edge_clusters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion these should be converted to fixtures. At a glance it looks like there should be two fixtures:

@pytest.fixture
def mock_success_api_call(mock_call_api):
    mock_call_api.return_value = {...}  # _mock_edge_clusters
    yield mock_call_api

    
@pytest.fixture
def mock_failure_api_call(mock_call_api):
    mock_call_api.return_value = {...}  # error_json
    yield mock_call_api    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants