test_server   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Functions

Rating   Name   Duplication   Size   Complexity  
A test_get_static_path() 0 4 1
A test_favicon() 0 7 1
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/logo-128.png' in actual.path
21
22