-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(api/tests): adjusted tests to tracker
- Loading branch information
Showing
3 changed files
with
46 additions
and
15 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 |
---|---|---|
@@ -1,14 +1,10 @@ | ||
from unittest.mock import ANY | ||
|
||
import pytest | ||
from django.core.management import call_command | ||
|
||
from outdated.outdated.synchroniser import Synchroniser | ||
|
||
|
||
@pytest.mark.django_db(transaction=True) | ||
def test_syncproject(project_factory, mocker): | ||
project = project_factory.create(repo="github.com/projectcaluma/caluma") | ||
sync_init_mocker = mocker.spy(Synchroniser, "__init__") | ||
def test_syncproject(project, tracker_mock, tracker_init_mock): | ||
tracker_sync_mock = tracker_mock("sync") | ||
call_command("syncproject", project.name) | ||
sync_init_mocker.assert_called_once_with(ANY, project) # ANY == self | ||
tracker_init_mock.assert_called_once_with(project) | ||
tracker_sync_mock.assert_called_once() |