Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Unified Diff: recipe_engine/third_party/requests/tests/test_structures.py

Issue 2164713003: Vendor requests. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Fix deps.pyl Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_engine/third_party/requests/tests/test_structures.py
diff --git a/recipe_engine/third_party/requests/tests/test_structures.py b/recipe_engine/third_party/requests/tests/test_structures.py
deleted file mode 100644
index 1c332bb22561fec9d19d2aa8adf27d639e17a682..0000000000000000000000000000000000000000
--- a/recipe_engine/third_party/requests/tests/test_structures.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# coding: utf-8
-import pytest
-
-from requests.structures import CaseInsensitiveDict, LookupDict
-
-
-class TestCaseInsensitiveDict:
-
- @pytest.fixture(autouse=True)
- def setup(self):
- """
- CaseInsensitiveDict instance with "Accept" header.
- """
- self.case_insensitive_dict = CaseInsensitiveDict()
- self.case_insensitive_dict['Accept'] = 'application/json'
-
- def test_list(self):
- assert list(self.case_insensitive_dict) == ['Accept']
-
- possible_keys = pytest.mark.parametrize('key', ('accept', 'ACCEPT', 'aCcEpT', 'Accept'))
-
- @possible_keys
- def test_getitem(self, key):
- assert self.case_insensitive_dict[key] == 'application/json'
-
- @possible_keys
- def test_delitem(self, key):
- del self.case_insensitive_dict[key]
- assert key not in self.case_insensitive_dict
-
- def test_lower_items(self):
- assert list(self.case_insensitive_dict.lower_items()) == [('accept', 'application/json')]
-
- def test_repr(self):
- assert repr(self.case_insensitive_dict) == "{'Accept': 'application/json'}"
-
- def test_copy(self):
- copy = self.case_insensitive_dict.copy()
- assert copy is not self.case_insensitive_dict
- assert copy == self.case_insensitive_dict
-
- @pytest.mark.parametrize(
- 'other, result', (
- ({'AccePT': 'application/json'}, True),
- ({}, False),
- (None, False)
- )
- )
- def test_instance_equality(self, other, result):
- assert (self.case_insensitive_dict == other) is result
-
-
-class TestLookupDict:
-
- @pytest.fixture(autouse=True)
- def setup(self):
- """
- LookupDict instance with "bad_gateway" attribute.
- """
- self.lookup_dict = LookupDict('test')
- self.lookup_dict.bad_gateway = 502
-
- def test_repr(self):
- assert repr(self.lookup_dict) == "<lookup 'test'>"
-
- get_item_parameters = pytest.mark.parametrize(
- 'key, value', (
- ('bad_gateway', 502),
- ('not_a_key', None)
- )
- )
-
- @get_item_parameters
- def test_getitem(self, key, value):
- assert self.lookup_dict[key] == value
-
- @get_item_parameters
- def test_get(self, key, value):
- assert self.lookup_dict.get(key) == value
« no previous file with comments | « recipe_engine/third_party/requests/tests/test_requests.py ('k') | recipe_engine/third_party/requests/tests/test_testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698