Browse Source

Merge branch 'master' of git://natpen.net/gus

master
René Wagner 10 months ago
parent
commit
105f1ca2c6
  1. 8
      gus/crawl.py
  2. 3
      tests/gus/lib/test_gemini.py

8
gus/crawl.py

@ -9,7 +9,13 @@ import pickle
import time
from urllib.parse import urljoin, uses_relative, uses_netloc
import feedparser
# TODO: this import breaks with Python 3.9, but all code that relies
# on this code path is currently dead code, so for now I'm just
# commenting out the import. It would be nice to make an actual
# decision soon about whether or not feed-based updating is even
# worth keeping around. If not, the dead code paths could simply
# deleted, and GUS would get a bit simpler :)
# import feedparser
import peewee
from . import constants

3
tests/gus/lib/test_gemini.py

@ -46,7 +46,10 @@ text
@pytest.mark.parametrize("test_input,expected_result", [
(["gemini://gus.guru", None, None], [True, "gemini://gus.guru", "gus.guru"]),
(["/bar", "gemini://gus.guru/foo", None], [False, None, None]),
(["/bar", "gemini://gus.guru/foo/", None], [False, None, None]),
(["/bar", "gemini://gus.guru/foo", "gus.guru"], [True, "gemini://gus.guru/bar", "gus.guru"]),
(["/bar", "gemini://gus.guru/foo/", "gus.guru"], [True, "gemini://gus.guru/bar", "gus.guru"]),
(["bar", "gemini://gus.guru/foo", "gus.guru"], [True, "gemini://gus.guru/bar", "gus.guru"]),
(["bar", "gemini://gus.guru/foo/", "gus.guru"], [True, "gemini://gus.guru/foo/bar", "gus.guru"]),
# (["bar", "gemini://gus.guru/foo", "gus.guru"], [True, "gemini://gus.guru/foo/bar", "gus.guru"]),
(["//foo.com", None, None], [True, "gemini://foo.com", "foo.com"]),

Loading…
Cancel
Save