Skip to content

Commit 7c06b57

Browse files
chore(xtest): Fix type error when parsing ntdf
- Used wrong policy type for parser
1 parent 61cec21 commit 7c06b57

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

xtest/test_policytypes.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,22 +318,22 @@ def assert_expected_attrs(
318318
False
319319
), f"Unsupported container & policy type pair [{tdfs.simple_container(c)} & {pt}]"
320320
return
321-
policy: tdfs.PolicyBody
321+
policy: tdfs.Policy
322322
match tdfs.simple_container(c):
323323
case "nano":
324324
envelope = nano.parse(f.read())
325325
assert envelope.header.version.version == 12
326326
assert envelope.header.policy.policy_type == nano.PolicyType.EMBEDDED
327327
assert envelope.header.policy.embedded
328-
policy = tdfs.PolicyBody.model_validate_json(
328+
policy = tdfs.Policy.model_validate_json(
329329
envelope.header.policy.embedded
330330
)
331331
case _:
332332
manifest = tdfs.manifest(ct_file)
333-
policy_with_uuid = manifest.encryptionInformation.policy_object
334-
policy = policy_with_uuid.body
333+
policy = manifest.encryptionInformation.policy_object
335334

336-
assert not policy.dissem
337-
assert policy.dataAttributes is not None
338-
attrs = [v.attribute for v in policy.dataAttributes]
335+
assert policy.body
336+
assert not policy.body.dissem
337+
assert policy.body.dataAttributes
338+
attrs = [v.attribute for v in policy.body.dataAttributes]
339339
assert sorted(attrs) == sorted(fqns)

0 commit comments

Comments
 (0)