mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-30 19:14:43 +00:00
Test on GitHub with httpbin from a container
Avoid failures due to the web service.
This commit is contained in:
parent
4d9a39089d
commit
1cb7f3d78a
2 changed files with 13 additions and 3 deletions
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
|
@ -30,6 +30,12 @@ jobs:
|
||||||
- python-version: "3.8"
|
- python-version: "3.8"
|
||||||
toxenv: minreqs
|
toxenv: minreqs
|
||||||
|
|
||||||
|
services:
|
||||||
|
httpbin:
|
||||||
|
image: kennethreitz/httpbin
|
||||||
|
ports:
|
||||||
|
- 8080:80
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install OS dependencies
|
- name: Install OS dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,19 @@
|
||||||
"""
|
"""
|
||||||
Test http stuff with httpbin.org.
|
Test http stuff with httpbin.org.
|
||||||
"""
|
"""
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
from tests import need_network
|
from tests import need_network
|
||||||
from . import LinkCheckTest
|
from . import LinkCheckTest
|
||||||
|
|
||||||
|
|
||||||
def get_httpbin_url(path):
|
def get_httpbin_url(path):
|
||||||
"""Get httpbin URL. Note that this also could be a local
|
"""Get httpbin URL."""
|
||||||
httpbin installation, but right now this uses the official site."""
|
if "CI" in os.environ:
|
||||||
return "http://httpbin.org%s" % path
|
host = "localhost:8080"
|
||||||
|
else:
|
||||||
|
host = "httpbin.org"
|
||||||
|
return f"http://{host}{path}"
|
||||||
|
|
||||||
|
|
||||||
class TestHttpbin(LinkCheckTest):
|
class TestHttpbin(LinkCheckTest):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue