MCPcopy
hub / github.com/aosabook/500lines / test_link_cycle

Method test_link_cycle

crawler/code/test.py:135–148  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133 self.assertStat(1, url=self.app_url + '/foo', status=404)
134
135 def test_link_cycle(self):
136 # foo and bar link to each other.
137 url = self.add_page('/foo', ['/bar'])
138 self.add_page('/bar', ['/foo'])
139 self.crawl([url])
140 self.assertDoneCount(2)
141 self.assertStat(url=self.app_url + '/foo',
142 num_urls=1,
143 num_new_urls=1)
144
145 self.assertStat(1,
146 url=self.app_url + '/bar',
147 num_urls=1,
148 num_new_urls=0)
149
150 def test_prohibited_host(self):
151 # Link to example.com.

Callers

nothing calls this directly

Calls 4

add_pageMethod · 0.95
crawlMethod · 0.95
assertDoneCountMethod · 0.95
assertStatMethod · 0.95

Tested by

no test coverage detected