Passed
Push — master ( 8bd622...3253a7 )
by Matěj
04:31 queued 11s
created

tests.test_base   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 22
dl 0
loc 30
rs 10
c 0
b 0
f 0

4 Functions

Rating   Name   Duplication   Size   Complexity  
A test_nonsense_hostname() 0 4 1
A test_nonexistent_hostname() 0 4 1
A test_bad_password() 0 6 1
A test_ok() 0 6 1
1
from . import base
2
3
4
def test_nonsense_hostname():
5
    nxc = base.NextCloud("foo", "bar", "baz")
6
    issues = nxc.get_connection_issues()
7
    assert "foo" in issues
8
9
10
def test_nonexistent_hostname():
11
    nxc = base.NextCloud("http://loooooool.no-way", "bar", "baz")
12
    issues = nxc.get_connection_issues()
13
    assert "loooooool.no-way" in issues
14
15
16
def test_bad_password():
17
    nxc = base.NextCloud(
18
            base.NEXTCLOUD_URL,
19
            base.NEXTCLOUD_USERNAME, "Just Trolling")
20
    issues = nxc.get_connection_issues()
21
    assert "not logged in" in issues
22
23
24
def test_ok():
25
    nxc = base.NextCloud(
26
            base.NEXTCLOUD_URL,
27
            base.NEXTCLOUD_USERNAME, base.NEXTCLOUD_PASSWORD)
28
    issues = nxc.get_connection_issues()
29
    assert not issues
30