-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change how cli.py works to make it easier to test (wrap the underlyin…
…g internal function)
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# ---------------------------------------------------------------------------- | ||
# Copyright © 2016, Continuum Analytics, Inc. All rights reserved. | ||
# | ||
# The full license is in the file LICENSE.txt, distributed with this software. | ||
# ---------------------------------------------------------------------------- | ||
from __future__ import absolute_import, print_function | ||
|
||
import anaconda_project.cli as cli | ||
|
||
|
||
def test_main(monkeypatch): | ||
result = {} | ||
|
||
def mock_main(*args, **kwargs): | ||
result['args'] = args | ||
result['kwargs'] = kwargs | ||
|
||
monkeypatch.setattr('anaconda_project.internal.cli.main.main', mock_main) | ||
cli.main() | ||
|
||
assert dict(args=(), kwargs={}) == result |