-
Notifications
You must be signed in to change notification settings - Fork 0
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 #16 from totem/develop
0.1.9 Release
- Loading branch information
Showing
9 changed files
with
136 additions
and
91 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,4 +1,4 @@ | ||
__version__ = '0.1.8' | ||
__version__ = '0.1.9' | ||
__author__ = 'sukrit' | ||
|
||
import logging | ||
|
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
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
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,55 @@ | ||
from mock import MagicMock | ||
from nose.tools import eq_ | ||
from deployer.tasks import util | ||
|
||
|
||
def test_as_dict_for_dictionary_type(): | ||
""" | ||
Should return the input dictionary | ||
""" | ||
# Given: Input dictionary | ||
input = { | ||
'mockkey': 'mockvalue' | ||
} | ||
|
||
# When: I invoke as_dict with dict type | ||
output = util.as_dict(input) | ||
|
||
# Then: Input dictionary is returned | ||
eq_(output, input) | ||
|
||
|
||
def test_as_dict_for_obj_with_to_dict_method(): | ||
""" | ||
Should return the dict representation | ||
""" | ||
# Given: Input Object | ||
input = MagicMock() | ||
input.to_dict.return_value = { | ||
'mockkey': 'mockvalue' | ||
} | ||
|
||
# When: I invoke as_dict with dict type | ||
output = util.as_dict(input) | ||
|
||
# Then: Dictionary representation is returned | ||
eq_(output, { | ||
'mockkey': 'mockvalue' | ||
}) | ||
|
||
|
||
def test_as_dict_for_obj_with_no_to_dict_method(): | ||
""" | ||
Should return the dict representation | ||
""" | ||
# Given: Input object | ||
input = 'test' | ||
|
||
# When: I invoke as_dict with dict type | ||
output = util.as_dict(input) | ||
|
||
# Then: Dictionary representation is returned | ||
eq_(output, { | ||
'code': 'INTERNAL', | ||
'message': repr(input) | ||
}) |