1- import boto3
2- from moto import mock_aws
3-
4- from nrlf .core .authoriser import get_pointer_permissions , parse_permissions_file
5- from nrlf .core .config import Config
6- from nrlf .core .logger import LogReference , logger
7- from nrlf .core .model import ClientRpDetails , ConnectionMetadata
1+ from nrlf .core .authoriser import parse_permissions_file
82from nrlf .core .request import parse_headers
93from nrlf .tests .events import create_headers
104
@@ -25,33 +19,33 @@ def test_authoriser_parse_permission_file_with_permission_file():
2519 assert metadata_result == ["http://snomed.info/sct|736253001" ]
2620
2721
28- @mock_aws
29- def test_authoriser_get_pointer_permissions_first_pass (mocker ):
30- # Spy on key used to lookup in s3?
31- spy = mocker .spy (logger , "log" )
22+ # @mock_aws
23+ # def test_authoriser_get_pointer_permissions_first_pass(mocker):
24+ # # Spy on key used to lookup in s3?
25+ # spy = mocker.spy(logger, "log")
3226
33- conn = boto3 .resource ("s3" , region_name = "eu-west-2" )
34- # We need to create the bucket since this is all in Moto's 'virtual' AWS account
35- conn .create_bucket (Bucket = "auth-store-i-promise" )
27+ # # conn = boto3.resource("s3", region_name="eu-west-2")
28+ # # # We need to create the bucket since this is all in Moto's 'virtual' AWS account
29+ # # conn.create_bucket(Bucket="auth-store-i-promise")
3630
37- rp_deets = ClientRpDetails .model_validate (
38- {"developer.app.name" : "ODS123-app-id" , "developer.app.id" : "ODS123-app-id" }
39- )
31+ # rp_deets = ClientRpDetails.model_validate(
32+ # {"developer.app.name": "ODS123-app-id", "developer.app.id": "ODS123-app-id"}
33+ # )
4034
41- conn = ConnectionMetadata .model_validate (
42- {
43- "nrl.ods-code" : "ODS123" ,
44- "nrl.app-id" : "ODS123-app-id" ,
45- "client_rp_details" : rp_deets ,
46- }
47- )
35+ # conn = ConnectionMetadata.model_validate(
36+ # {
37+ # "nrl.ods-code": "ODS123",
38+ # "nrl.app-id": "ODS123-app-id",
39+ # "client_rp_details": rp_deets,
40+ # }
41+ # )
4842
49- get_pointer_permissions (
50- connection_metadata = conn , # fix this guy
51- config = Config (AUTH_STORE = "auth-store-i-promise" ),
52- request_path = "/producer/DocumentReference/_search" ,
53- )
43+ # get_pointer_permissions(
44+ # connection_metadata=conn, # fix this guy
45+ # config=Config(AUTH_STORE="auth-store-i-promise"),
46+ # request_path="/producer/DocumentReference/_search",
47+ # )
5448
55- expected_path = "producer/ODS123-app-id/ODS123.json"
49+ # expected_path = "producer/ODS123-app-id/ODS123.json"
5650
57- spy .assert_called_with (LogReference .S3PERMISSIONS011 , expected_path )
51+ # spy.assert_called_with(LogReference.S3PERMISSIONS011, expected_path)
0 commit comments