-
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.
- Loading branch information
Showing
6 changed files
with
53 additions
and
11 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
include *.txt | ||
recursive-include accountable *.py |
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
File renamed without changes.
Empty file.
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,3 +1,32 @@ | ||
import mock | ||
|
||
from accountable.accountable import Accountable | ||
|
||
|
||
def config_values(): | ||
return { | ||
'username': 'testusername', | ||
'password': 'testpassword', | ||
'domain': 'testdomain', | ||
'create_config': True, | ||
} | ||
|
||
|
||
class TestAccountable(object): | ||
def test_initial_setup(self): | ||
assert 5 == 5 | ||
@mock.patch.object(Accountable, '_initial_setup') | ||
def test_initial_setup(self, mock_method): | ||
Accountable(**config_values()) | ||
mock_method.assert_called_once_with() | ||
|
||
@mock.patch.object(Accountable, '_load_config') | ||
def test_load_config(self, mock_method): | ||
Accountable(**config_values()) | ||
mock_method.assert_called_once_with() | ||
|
||
@mock.patch.object(Accountable, '_initial_setup') | ||
def test_does_not_setup_if_config_exists(self, mock_method): | ||
Accountable(**config_values()) | ||
do_not_create_config = config_values().copy() | ||
del do_not_create_config['create_config'] | ||
Accountable(**do_not_create_config) | ||
mock_method.assert_called_once_with() |
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