1 7
from panel.models.location import Location
2

3 7
def test_constructor():
4
    # When
5 7
    actual = Location()
6
    # Then
7 7
    assert actual.href == ""
8 7
    assert actual.hostname == ""
9 7
    assert actual.pathname == ""
10 7
    assert actual.protocol == ""
11 7
    assert actual.port == ""
12 7
    assert actual.search == ""
13 7
    assert actual.hash == ""
14 7
    assert actual.reload == True
15

16

17 7
def test_constructor_with__href():
18
    # Given
19 7
    href = "https://panel.holoviz.org/user_guide/Interact.html:80?color=blue#interact"
20
    # When
21 7
    actual = Location(
22
        href="https://panel.holoviz.org/user_guide/Interact.html:80?color=blue#interact"
23
    )
24
    # Then
25 7
    assert actual.href == href
26 7
    assert actual.hostname == ""
27 7
    assert actual.pathname == ""
28 7
    assert actual.protocol == ""
29 7
    assert actual.port == ""
30 7
    assert actual.search == ""
31 7
    assert actual.hash == ""
32 7
    assert actual.reload == True

Read our documentation on viewing source code .

Loading