"""Unit tests for the ows-product model.""" from owsrequest import request from owsrequest import test_utils from ddex_lambda_proxy.models import ows_product def test_get_product_for_upc(monkeypatch): """Test getting the product for a upc from ows-product.""" path = '/product/upc/1234567890' expected_status = 200 # The call spec list used by mock_ows_requests to mock these requests call_specs = [{ 'service': 'ows-product', 'path': path, 'status': expected_status}] monkeypatch.setattr( request, 'get', test_utils.mock_ows_requests(call_specs)) response = ows_product.get_product_for_upc('1234567890') assert response.status == expected_status