Example #1
0
def test_updated_components_none_updated(mocker, cachet_client,
                                         cachet_response):
    """Assert no components are considered updated if there are no actual changes"""
    mock_get = mocker.patch('cachetclient.cachet.Components.get')
    mock_get.return_value = cachet_response

    status = load_from_json('updated_components_none_updated.json')

    updated_components = list(cachet_client.updated_components(status))

    assert len(updated_components) == 0
Example #2
0
def test_updated_components_two_updated(mocker, cachet_client,
                                        cachet_response):
    """Assert the right components are considered updated"""
    mock_get = mocker.patch('cachetclient.cachet.Components.get')
    mock_get.return_value = cachet_response

    status = load_from_json('updated_components_two_updated.json')

    updated_components = list(cachet_client.updated_components(status))

    assert len(updated_components) == 2
    assert any(comp['id'] == 3 for comp in updated_components)
    assert any(comp['id'] == 6 for comp in updated_components)
Example #3
0
def saved_status_multi_updates():
    return load_from_json('saved_status_multi_updates.json')
Example #4
0
def matching_cases():
    return load_from_json('matching_components_cases.json')
Example #5
0
def matching_list():
    return load_from_json('matching_components_list.json')
Example #6
0
def cachet_response():
    return json.dumps(load_from_json('cachet_response.json'))