aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/multidict/tests
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2023-12-27 23:31:58 +0100
committerGitHub <noreply@github.com>2023-12-27 23:31:58 +0100
commitd67bfb4b4b7549081543e87a31bc6cb5c46ac973 (patch)
tree8674f2f1570877cb653e7ddcff37ba00288de15a /contrib/python/multidict/tests
parent1f6bef05ed441c3aa2d565ac792b26cded704ac7 (diff)
downloadydb-d67bfb4b4b7549081543e87a31bc6cb5c46ac973.tar.gz
Import libs 4 (#758)
Diffstat (limited to 'contrib/python/multidict/tests')
-rw-r--r--contrib/python/multidict/tests/test_multidict.py3
-rw-r--r--contrib/python/multidict/tests/test_mutable_multidict.py5
-rw-r--r--contrib/python/multidict/tests/test_version.py2
3 files changed, 9 insertions, 1 deletions
diff --git a/contrib/python/multidict/tests/test_multidict.py b/contrib/python/multidict/tests/test_multidict.py
index 706fc93e75..e2ad71ee34 100644
--- a/contrib/python/multidict/tests/test_multidict.py
+++ b/contrib/python/multidict/tests/test_multidict.py
@@ -199,6 +199,7 @@ class BaseMultiDictTest:
d.getone("key2")
assert d.getone("key2", "default") == "default"
+ assert d.getone(key="key2", default="default") == "default"
def test__iter__(
self,
@@ -532,6 +533,8 @@ class TestMultiDict(BaseMultiDictTest):
def test_get(self, cls: Type[MultiDict[int]]) -> None:
d = cls([("a", 1), ("a", 2)])
assert d["a"] == 1
+ assert d.get("a") == 1
+ assert d.get("z", 3) == 3
def test_items__repr__(self, cls: Type[MultiDict[str]]) -> None:
d = cls([("key", "value1")], key="value2")
diff --git a/contrib/python/multidict/tests/test_mutable_multidict.py b/contrib/python/multidict/tests/test_mutable_multidict.py
index 3d4d16ac03..3f66e279ad 100644
--- a/contrib/python/multidict/tests/test_mutable_multidict.py
+++ b/contrib/python/multidict/tests/test_mutable_multidict.py
@@ -44,6 +44,7 @@ class TestMutableMultiDict:
default = object()
assert d.getall("some_key", default) is default
+ assert d.getall(key="some_key", default=default) is default
def test_add(self, cls):
d = cls()
@@ -124,7 +125,7 @@ class TestMutableMultiDict:
def test_set_default(self, cls):
d = cls([("key", "one"), ("key", "two")], foo="bar")
assert "one" == d.setdefault("key", "three")
- assert "three" == d.setdefault("otherkey", "three")
+ assert "three" == d.setdefault(key="otherkey", default="three")
assert "otherkey" in d
assert "three" == d["otherkey"]
@@ -163,6 +164,7 @@ class TestMutableMultiDict:
d = cls(other="val")
assert "default" == d.pop("key", "default")
+ assert "default" == d.pop(key="key", default="default")
assert "other" in d
def test_pop_raises(self, cls):
@@ -229,6 +231,7 @@ class TestMutableMultiDict:
def test_popall_default(self, cls):
d = cls()
assert "val" == d.popall("key", "val")
+ assert "val" == d.popall(key="key", default="val")
def test_popall_key_error(self, cls):
d = cls()
diff --git a/contrib/python/multidict/tests/test_version.py b/contrib/python/multidict/tests/test_version.py
index 067d6210ce..9b25c0e72d 100644
--- a/contrib/python/multidict/tests/test_version.py
+++ b/contrib/python/multidict/tests/test_version.py
@@ -95,6 +95,8 @@ class VersionMixin:
v = self.getver(m)
m.popone("key2", "default")
assert self.getver(m) == v
+ m.popone(key="key2", default="default")
+ assert self.getver(m) == v
def test_popone_key_error(self):
m = self.cls()