Ejemplo n.º 1
0
def test_schema_name_and_version(request_method):
    dr = dummy_request()
    dr.method = request_method
    expected_return_code = 200
    with patch('mycroft.views.schema.s3_bucket_action') as bucket_action:
        bucket_action.return_value = {}
        actual_return_code, _ = schema_name_and_version(dr)
    assert actual_return_code == expected_return_code
Ejemplo n.º 2
0
def test_schema_name_and_version_errors(err_instance, expected_return_code):
    dr = dummy_request()
    with patch('mycroft.views.schema.s3_bucket_action') as bucket_action:
        bucket_action.side_effect = err_instance
        actual_return_code, _ = schema_name_and_version(dr)
    assert actual_return_code == expected_return_code