-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from man-group/feature/scheduling
fix: use correct default scheduler mongo database
- Loading branch information
Showing
4 changed files
with
22 additions
and
3 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,19 @@ | ||
import mock | ||
|
||
from notebooker.web.app import setup_scheduler | ||
|
||
|
||
def test_setup_scheduler_disabled(flask_app, webapp_config): | ||
webapp_config.DISABLE_SCHEDULER = True | ||
app = setup_scheduler(flask_app, webapp_config) | ||
assert app.apscheduler is None | ||
|
||
|
||
def test_setup_scheduler(flask_app, webapp_config, test_db_name, test_lib_name): | ||
webapp_config.DISABLE_SCHEDULER = False | ||
scheduler_coll = f"{test_lib_name}_scheduler" | ||
with mock.patch("notebooker.web.app.BackgroundScheduler") as sched: | ||
with mock.patch("notebooker.web.app.MongoDBJobStore") as jobstore: | ||
app = setup_scheduler(flask_app, webapp_config) | ||
assert app.apscheduler is not None | ||
jobstore.assert_called_with(database=test_db_name, collection=scheduler_coll, client=mock.ANY) |
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