-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ingest): support for env variable in cli (#3215)
- Loading branch information
1 parent
f307521
commit 97bed71
Showing
3 changed files
with
69 additions
and
6 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,11 @@ | ||
from datahub.cli import cli_utils | ||
|
||
|
||
def test_first_non_null(): | ||
assert cli_utils.first_non_null([]) is None | ||
assert cli_utils.first_non_null([None]) is None | ||
assert cli_utils.first_non_null([None, "1"]) == "1" | ||
assert cli_utils.first_non_null([None, "1", "2"]) == "1" | ||
assert cli_utils.first_non_null(["3", "1", "2"]) == "3" | ||
assert cli_utils.first_non_null(["", "1", "2"]) == "1" | ||
assert cli_utils.first_non_null([" ", "1", "2"]) == "1" |