Passed
Pull Request — master (#4216)
by Matěj
02:33 queued 10s
created

test_yaml   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 39
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
B test_list_or_string_update() 0 45 1
1
import ssg.yaml
2
3
4
def test_list_or_string_update():
5
    assert ssg.yaml.update_yaml_list_or_string(
6
        "",
7
        "",
8
    ) == ""
9
10
    assert ssg.yaml.update_yaml_list_or_string(
11
        "something",
12
        "",
13
    ) == "something"
14
15
    assert ssg.yaml.update_yaml_list_or_string(
16
        ["something"],
17
        "",
18
    ) == "something"
19
20
    assert ssg.yaml.update_yaml_list_or_string(
21
        "",
22
        "else",
23
    ) == "else"
24
25
    assert ssg.yaml.update_yaml_list_or_string(
26
        "something",
27
        "else",
28
    ) == ["something", "else"]
29
30
    assert ssg.yaml.update_yaml_list_or_string(
31
        "",
32
        ["something", "else"],
33
    ) == ["something", "else"]
34
35
    assert ssg.yaml.update_yaml_list_or_string(
36
        ["something", "else"],
37
        "",
38
    ) == ["something", "else"]
39
40
    assert ssg.yaml.update_yaml_list_or_string(
41
        "something",
42
        ["entirely", "else"],
43
    ) == ["something", "entirely", "else"]
44
45
    assert ssg.yaml.update_yaml_list_or_string(
46
        ["something", "entirely"],
47
        ["entirely", "else"],
48
    ) == ["something", "entirely", "entirely", "else"]
49