示例#1
0
def test_schema(log_name):
    dr = dummy_request()
    dr.matchdict["log_name"] = log_name
    expected_return_code = 200
    with patch('mycroft.views.schema.s3_bucket_action') as bucket_action:
        bucket_action.return_value = {}
        actual_return_code, _ = schema(dr)
    assert actual_return_code == expected_return_code
示例#2
0
def test_schema_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(dr)
    assert actual_return_code == expected_return_code