-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore None type values in kwargs (#7)
* Ignore None type values in kwargs * Update gcn_kafka/core.py Co-authored-by: Leo Singer <[email protected]> * test methods * Fixed looking at the wrong object * Update gcn_kafka/test/test_core.py Co-authored-by: Leo Singer <[email protected]> * Update gcn_kafka/test/test_core.py Co-authored-by: Leo Singer <[email protected]> Co-authored-by: Leo Singer <[email protected]>
- Loading branch information
Showing
2 changed files
with
41 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,34 @@ | ||
from ..core import update_config | ||
|
||
|
||
def test_update_config_no_overwrite(): | ||
config = { | ||
'client_id':'qwertyuiopasdfghjklzxcvbnm', | ||
'client_secret':'qwertyuiopljhgfdsazxcvbnmlkjhgfdsaertyuio', | ||
'domain':'test.test.test' | ||
} | ||
|
||
newConfig = update_config( | ||
config, | ||
client_id=None, | ||
client_secret=None | ||
) | ||
|
||
assert newConfig == config | ||
|
||
|
||
def test_update_config_with_overwrite(): | ||
config = { | ||
'client_id':'qwertyuiopasdfghjklzxcvbnm', | ||
'client_secret':'qwertyuiopljhgfdsazxcvbnmlkjhgfdsaertyuio', | ||
'domain':'test.test.test' | ||
} | ||
|
||
newConfig = update_config( | ||
config, | ||
client_id="client_id update Success", | ||
client_secret="client_secret update Success" | ||
) | ||
|
||
assert newConfig['client_id'] == "client_id update Success" | ||
assert newConfig['client_secret'] == "client_secret update Success" |