Completed
Push — master ( 725799...d9d8f9 )
by Bjorn
01:03
created

tests.test_multifiles()   A

Complexity

Conditions 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 3
dl 0
loc 10
rs 9.4286
1
# -*- coding: utf-8 -*-
2
3
from hashlib import md5
4
from yamldirs import create_files
5
from dkfileutils import changed
6
7
8
def test_empty_digest():
9
    files = """
10
        emptydir:
11
            - empty
12
    """
13
    with create_files(files) as emptydir:
14
        assert changed.digest(emptydir) == md5("").hexdigest()
15
16
17
def test_changed():
18
    files = """
19
        emptydir:
20
            - empty
21
    """
22
    with create_files(files) as emptydir:
23
        assert changed.changed(emptydir)
24
25
26
def test_missing():
27
    assert changed.changed("this-directory-doesnt-exist")
28
29
30
def test_multifiles():
31
    files = """
32
        a:
33
            - b: |
34
                hello
35
            - c: |
36
                world
37
    """
38
    with create_files(files) as a:
39
        assert changed.changed(a)
40