Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
subbyte committed Nov 29, 2023
1 parent 49309df commit a8486ac
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -881,3 +881,16 @@ def test_email(self):
observed_data = translation_objects[1]
stix_objects = observed_data.get("objects")
assert len(stix_objects) == 8
for k,v in stix_objects.items():
print(f"{k}: {v}")
emailmsg = stix_objects.get("2")
assert (
emailmsg and emailmsg.get("type") == "email-message" and
emailmsg.get("subject") == "Check out this picture of a cat!"
)
from_email = stix_objects.get(emailmsg.get("from_ref"))
assert from_email and from_email.get("value") == "[email protected]"
to_emails = {stix_objects.get(ref).get("value") for ref in emailmsg.get("to_refs")}
assert to_emails == {"[email protected]", "[email protected]"}
filenames = {stix_objects[str(ref)]["name"] for ref in range(len(stix_objects)) if stix_objects[str(ref)] and stix_objects[str(ref)]["type"] == "file"}
assert filenames == {"tabby.zip", "tabby.html"}

0 comments on commit a8486ac

Please sign in to comment.