| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import pytest |
||
| 2 | from starlette.responses import FileResponse |
||
| 3 | |||
| 4 | import graphinate.server.starlette.views |
||
| 5 | from graphinate.server.web import get_static_path |
||
| 6 | |||
| 7 | |||
| 8 | def test_get_static_path(): |
||
| 9 | path = 'this_is_a_path' |
||
| 10 | actual_path = get_static_path(path) |
||
| 11 | assert f'static/{path}' in actual_path.as_posix() |
||
| 12 | |||
| 13 | |||
| 14 | @pytest.mark.asyncio() |
||
| 15 | async def test_favicon(): |
||
| 16 | actual = await graphinate.server.starlette.views.favicon(None) |
||
| 17 | |||
| 18 | assert isinstance(actual, FileResponse) |
||
| 19 | assert actual.media_type == 'image/png' |
||
| 20 | assert 'src/graphinate/server/web/static/images/network_graph.png' in actual.path |
||
| 21 | |||
| 22 |