def test_describe_dataset(make_stubber, error_code): lookoutvision_client = boto3.client('lookoutvision') lookoutvision_stubber = make_stubber(lookoutvision_client) project_name = 'test-project_name' dataset_type = 'train' status = 'CREATE_COMPLETE' message = 'Test message' image_stats = {'Total': 5, 'Labeled': 2, 'Normal': 2, 'Anomaly': 1} lookoutvision_stubber.stub_describe_dataset(project_name, dataset_type, status, message, image_stats, error_code=error_code) if error_code is None: Datasets.describe_dataset(lookoutvision_client, project_name, dataset_type) else: with pytest.raises(ClientError) as exc_info: Datasets.describe_dataset(lookoutvision_client, project_name, dataset_type) assert exc_info.value.response['Error']['Code'] == error_code