This repository has been archived by the owner on Feb 19, 2025. It is now read-only.
-
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.
Merge pull request #2 from Jonxslays/issue/1
Add support for update key
- Loading branch information
Showing
12 changed files
with
295 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from __future__ import annotations | ||
|
||
from unittest import mock | ||
|
||
import pytest | ||
|
||
from unkey import UNDEFINED | ||
from unkey import BaseService | ||
|
||
|
||
@pytest.fixture() | ||
def service() -> BaseService: | ||
return BaseService(mock.Mock(), mock.Mock()) | ||
|
||
|
||
def test_generate_map(service: BaseService) -> None: | ||
result = service._generate_map(one=1, two=2) # type: ignore | ||
|
||
assert result == {"one": 1, "two": 2} | ||
|
||
|
||
def test_generate_map_with_undefined(service: BaseService) -> None: | ||
result = service._generate_map(one=1, two=UNDEFINED) # type: ignore | ||
|
||
assert result == {"one": 1} | ||
|
||
|
||
def test_generate_map_with_none(service: BaseService) -> None: | ||
result = service._generate_map(one=1, two=None) # type: ignore | ||
|
||
assert result == {"one": 1, "two": None} |
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
Oops, something went wrong.