MCPcopy
hub / github.com/scrapy/scrapy / test_replace_data

Method test_replace_data

tests/test_http_request_json.py:128–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 assert kwargs["allow_nan"] is True
127
128 def test_replace_data(self):
129 data1 = {
130 "name1": "value1",
131 }
132 data2 = {
133 "name2": "value2",
134 }
135 r1 = self.request_class(url="http://www.example.com/", data=data1)
136 r2 = r1.replace(data=data2)
137 assert r2.body == to_bytes(json.dumps(data2))
138
139 def test_replace_sort_keys(self):
140 """Test that replace provides sort_keys=True to json.dumps"""

Callers

nothing calls this directly

Calls 2

to_bytesFunction · 0.90
replaceMethod · 0.45

Tested by

no test coverage detected