-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_all.py
47 lines (38 loc) · 1.05 KB
/
test_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import pytest
from clean import hash128, get_path
import config
from dircheck import is_uuid
# throws an error if a path is referenced that does not exist
config.duplicates_file = ""
filestore = "/tmp"
config.filestore = filestore
@pytest.mark.parametrize(
["input", "expect"],
[
("4259b179-557a-4e04-8c9b-e06864a15d9a", 28),
("aa125bf6-2023-4787-92fc-816b2c932fc5", 65),
],
)
def test_hash128(input, expect):
assert hash128(input) == expect
@pytest.mark.parametrize(
["input", "expect"],
[("nope", False), ("4259b179-557a-4e04-8c9b-e06864a15d9a", True)],
)
def test_is_uuid(input, expect):
assert is_uuid(input) == expect
@pytest.mark.parametrize(
["input", "expect"],
[
(
"4259b179-557a-4e04-8c9b-e06864a15d9a",
"/tmp/28/4259b179-557a-4e04-8c9b-e06864a15d9a",
),
(
"d08de2ec-bc4d-46c8-b7f6-c5d243ec8027",
"/tmp/126/d08de2ec-bc4d-46c8-b7f6-c5d243ec8027",
),
],
)
def test_get_path(input, expect):
assert get_path(input) == expect