@@ -993,22 +993,27 @@ def testfunc(a: int, b: float = 0.1) -> ty.NamedTuple("Output", [("out", float)]
993
993
return a + b
994
994
995
995
from glob import glob
996
+ import json
996
997
997
998
funky = testfunc (a = 2 , audit_flags = AuditFlag .PROV , messengers = FileMessenger ())
998
999
funky .cache_dir = tmpdir
999
1000
funky ()
1000
1001
message_path = tmpdir / funky .checksum / "messages"
1001
1002
# go through each jsonld file in message_path and check if the label field exists
1002
1003
json_content = []
1004
+
1003
1005
for file in glob (str (message_path ) + "/*.jsonld" ):
1004
1006
with open (file , "r" ) as f :
1005
1007
data = json .load (f )
1006
1008
print (data )
1007
- if "Label " in data :
1009
+ if "Activity_Label " in data :
1008
1010
json_content .append (True )
1009
- assert "testfunc" == data ["Label" ]
1010
- if "AssociatedWith" in data :
1011
- assert None == data ["AssociatedWith" ]
1011
+ assert data ["Activity_Label" ] == "testfunc"
1012
+ if "Entity_Label" in data :
1013
+ assert data ["Entity_Label" ] == None
1014
+ if "AssociatedWith" in data :
1015
+ assert None == data ["AssociatedWith" ]
1016
+
1012
1017
assert any (json_content )
1013
1018
1014
1019
@@ -1035,7 +1040,7 @@ def test_audit_shellcommandtask(tmpdir):
1035
1040
with open (file , "r" ) as f :
1036
1041
data = json .load (f )
1037
1042
print (data )
1038
- if "Label " in data :
1043
+ if "Activity_Label " in data :
1039
1044
label_content .append (True )
1040
1045
if "Command" in data :
1041
1046
command_content .append (True )
@@ -1174,7 +1179,7 @@ def testfunc(a: int, b: float = 0.1) -> ty.NamedTuple("Output", [("out", float)]
1174
1179
from glob import glob
1175
1180
1176
1181
assert len (glob (str (tmpdir / funky .checksum / "proc*.log" ))) == 1
1177
- assert len (glob (str (message_path / "*.jsonld" ))) == 7
1182
+ assert len (glob (str (message_path / "*.jsonld" ))) == 8
1178
1183
1179
1184
# commented out to speed up testing
1180
1185
collect_messages (tmpdir / funky .checksum , message_path , ld_op = "compact" )
0 commit comments