MCPcopy
hub / github.com/scrapy/scrapy / test_root_base_url

Method test_root_base_url

tests/test_selector.py:42–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40 ] == ["12"]
41
42 def test_root_base_url(self):
43 body = b'<html><form action="/path"><input name="a" /></form></html>'
44 url = "http://example.com"
45 response = TextResponse(url=url, body=body, encoding="utf-8")
46 sel = Selector(response)
47 assert url == sel.root.base
48
49 def test_flavor_detection(self):
50 text = b'<div><img src="a.jpg"><p>Hello</div>'

Callers

nothing calls this directly

Calls 2

TextResponseClass · 0.90
SelectorClass · 0.90

Tested by

no test coverage detected