mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
737115ea14
commit
1876975e3b
3 changed files with 1070 additions and 1063 deletions
1064
tests/test_html.py
1064
tests/test_html.py
File diff suppressed because it is too large
Load diff
1045
tests/test_table_html.py
Normal file
1045
tests/test_table_html.py
Normal file
File diff suppressed because it is too large
Load diff
24
tests/utils.py
Normal file
24
tests/utils.py
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
def assert_footer_links(soup):
|
||||||
|
footer_links = soup.find("footer").findAll("a")
|
||||||
|
assert 4 == len(footer_links)
|
||||||
|
datasette_link, license_link, source_link, about_link = footer_links
|
||||||
|
assert "Datasette" == datasette_link.text.strip()
|
||||||
|
assert "tests/fixtures.py" == source_link.text.strip()
|
||||||
|
assert "Apache License 2.0" == license_link.text.strip()
|
||||||
|
assert "About Datasette" == about_link.text.strip()
|
||||||
|
assert "https://datasette.io/" == datasette_link["href"]
|
||||||
|
assert (
|
||||||
|
"https://github.com/simonw/datasette/blob/main/tests/fixtures.py"
|
||||||
|
== source_link["href"]
|
||||||
|
)
|
||||||
|
assert (
|
||||||
|
"https://github.com/simonw/datasette/blob/main/LICENSE" == license_link["href"]
|
||||||
|
)
|
||||||
|
assert "https://github.com/simonw/datasette" == about_link["href"]
|
||||||
|
|
||||||
|
|
||||||
|
def inner_html(soup):
|
||||||
|
html = str(soup)
|
||||||
|
# This includes the parent tag - so remove that
|
||||||
|
inner_html = html.split(">", 1)[1].rsplit("<", 1)[0]
|
||||||
|
return inner_html.strip()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue