-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"} |