mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-30 18:50:58 +00:00
Use mocked dir for web-ui redirection test
This commit is contained in:
parent
7d75b6248d
commit
41026c74c1
@ -62,6 +62,13 @@ def test_web_ui(http_root, tmpdir):
|
||||
|
||||
|
||||
def test_web_ui_not_found(http_root, tmpdir):
|
||||
with patch('gns3server.utils.static.get_static_dir') as mock:
|
||||
mock.return_value = str(tmpdir)
|
||||
os.makedirs(str(tmpdir / 'web-ui'))
|
||||
tmpfile = static.get_static_path('web-ui/index.html')
|
||||
with open(tmpfile, 'w+') as f:
|
||||
f.write('world')
|
||||
|
||||
response = http_root.get('/static/web-ui/not-found.txt')
|
||||
# should serve web-ui/index.html
|
||||
assert response.status == 200
|
||||
|
Loading…
Reference in New Issue
Block a user