-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed level of kwargs merger method.
- Loading branch information
1 parent
2fef445
commit 769e395
Showing
4 changed files
with
60 additions
and
61 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,29 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Tests for base module code""" | ||
|
||
from snappy_pipeline.base import merge_kwargs | ||
|
||
|
||
def test_merge_kwargs(): | ||
"""Tests dictionary merger for shortcut sheet keyword arguments.""" | ||
# Initialise variables | ||
global_kwargs = {1: "one", 2: "two"} | ||
sheet_kwargs = {3: "three"} | ||
merged_kwargs = {1: "one", 2: "two", 3: "three"} | ||
|
||
# None if both none | ||
expected = None | ||
actual = merge_kwargs(first_kwargs=None, second_kwargs=None) | ||
assert actual == expected | ||
|
||
# Only sheet if global is none | ||
actual = merge_kwargs(first_kwargs=None, second_kwargs=sheet_kwargs) | ||
assert actual == sheet_kwargs | ||
|
||
# Only global if sheet is none | ||
actual = merge_kwargs(first_kwargs=global_kwargs, second_kwargs=None) | ||
assert actual == global_kwargs | ||
|
||
# Merged if both presents | ||
actual = merge_kwargs(first_kwargs=global_kwargs, second_kwargs=sheet_kwargs) | ||
assert actual == merged_kwargs |
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