-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow
APIRootUrl
, APIPathMode
and APIPathStrip
to be set in pre…
…built (#176)
- Loading branch information
1 parent
bb4fb36
commit 9c2ce0f
Showing
7 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from fastui import prebuilt_html | ||
|
||
|
||
def test_prebuilt_html(): | ||
html = prebuilt_html() | ||
assert html.startswith('<!doctype html>') | ||
assert 'https://cdn.jsdelivr.net/npm/@pydantic/fastui-prebuilt' in html | ||
assert '<title></title>' in html | ||
assert '<meta name="fastui:APIRootUrl"' not in html | ||
assert '<meta name="fastui:APIPathMode"' not in html | ||
assert '<meta name="fastui:APIPathStrip"' not in html | ||
|
||
|
||
def test_prebuilt_html_meta_tags(): | ||
html = prebuilt_html( | ||
title='Test Title', | ||
api_root_url='/admin/api', | ||
api_path_mode='query', | ||
api_path_strip='/admin', | ||
) | ||
assert '<title>Test Title</title>' in html | ||
assert '<meta name="fastui:APIRootUrl" content="/admin/api" />' in html | ||
assert '<meta name="fastui:APIPathMode" content="query" />' in html | ||
assert '<meta name="fastui:APIPathStrip" content="/admin" />' in html |