U r_ @sRddlZddlmmZddlZddlZddlm Z e ddZ ddZ dS)N)appcCstddddddddddddd ddddd dd d d ddidddddddddddddddd ddddd idd!d"id d# S)$z Generates API GW Eventz{ "test": "body"}z /{proxy+}Z123456Z 1234567890ZPOSTz$c6af9ac6-7b61-11e6-9a41-93e8deadbeefZ 123456789012zCustom User Agent Stringz 127.0.0.1) ZapiKeyZuserArnZcognitoAuthenticationTypeZcallerZ userAgentuserZcognitoIdentityPoolIdZcognitoIdentityIdZcognitoAuthenticationProviderZsourceIp accountIdprod)Z resourceIdZapiIdZ resourcePath httpMethodZ requestIdridentityZstagefoobarz@1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)zen-US,en;q=0.8truefalsez127.0.0.1, 127.0.0.2ZUSzJtext/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.81Z443z.1234567890.execute-api.us-east-1.amazonaws.comhttpsz8aaaaaaaaaae3VYQb9jd-nvCd-de396Uhbp027Y2JvkCPNLmGJHqlaA==z max-age=0zgzip, deflate, sdch)ZViazAccept-LanguagezCloudFront-Is-Desktop-ViewerzCloudFront-Is-SmartTV-ViewerzCloudFront-Is-Mobile-ViewerzX-Forwarded-ForzCloudFront-Viewer-CountryZAcceptzUpgrade-Insecure-RequestszX-Forwarded-PortZHostzX-Forwarded-Protoz X-Amz-Cf-IdzCloudFront-Is-Tablet-Viewerz Cache-Controlz User-AgentzCloudFront-Forwarded-ProtozAccept-Encodingproxyz /examplepathZbazZqux) bodyresourceZrequestContextZqueryStringParametersZheadersZpathParametersrZstageVariablespathrrru/Users/shaanubh/Documents/code/Aws-saas-factory-ref-serverless-saas/server/product-service/tests/unit/test_handler.py apigw_events^ rc Cs^t|d}t|d}|d}d}||k}|sxtd|fd||ft|t|d}dd |i}tt|d}}}d }|d}||k}|std |fd ||ft|t|d}dd |i}tt|d}}}|d }d }||k}|sNtd|fd||ft|t|d}dd |i}tt|d}}}dS)NrrZ statusCode)==)z%(py1)s == %(py4)s)Zpy1Zpy4zassert %(py6)sZpy6message)in)z%(py1)s in %(py4)sz product list) rZ get_productjsonloads @pytest_ar_call_reprcompare _safereprAssertionError_format_explanation) rZmockerretdataZ @py_assert0Z @py_assert3Z @py_assert2Z @py_format5Z @py_format7rrrtest_get_productAs4 ,  ,  , r#) builtins @py_builtins_pytest.assertion.rewrite assertionrewriterrpytestsourcerfixturerr#rrrrs  8