-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allie Crevier
committed
Nov 6, 2020
1 parent
a3fe863
commit c8c5b6b
Showing
7 changed files
with
947 additions
and
103 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
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from securedrop_client.api_jobs.seen import SeenJob | ||
from tests import factory | ||
|
||
|
||
def test_seen(homedir, mocker, session, source): | ||
""" | ||
Check if we call add_star method if a source is not stared. | ||
""" | ||
file = factory.File(id=1, source=source["source"]) | ||
message = factory.Message(id=2, source=source["source"]) | ||
reply = factory.Reply(source=factory.Source()) | ||
session.add(file) | ||
session.add(message) | ||
session.add(reply) | ||
|
||
api_client = mocker.MagicMock() | ||
|
||
job = SeenJob([file], [message], [reply]) | ||
|
||
job.call_api(api_client, session) | ||
|
||
api_client.seen.assert_called_once_with([file], [message], [reply]) |
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
Oops, something went wrong.