(self)
| 550 | @test.support.requires_resource('network') |
| 551 | @test.support.system_must_validate_cert |
| 552 | def test_license_exists_at_url(self): |
| 553 | # This test is a bit fragile since it depends on the format of the |
| 554 | # string displayed by license in the absence of a LICENSE file. |
| 555 | url = license._Printer__data.split()[1] |
| 556 | req = urllib.request.Request(url, method='HEAD') |
| 557 | # Reset global urllib.request._opener |
| 558 | self.addCleanup(urllib.request.urlcleanup) |
| 559 | try: |
| 560 | with socket_helper.transient_internet(url): |
| 561 | with urllib.request.urlopen(req) as data: |
| 562 | code = data.getcode() |
| 563 | except urllib.error.HTTPError as e: |
| 564 | code = e.code |
| 565 | self.assertEqual(code, 200, msg="Can't find " + url) |
| 566 | |
| 567 | @support.cpython_only |
| 568 | def test_lazy_imports(self): |
nothing calls this directly
no test coverage detected