-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_sass.py
48 lines (36 loc) · 1.61 KB
/
test_sass.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
48
from sass_builder import validate_projectname, validate_path, has_folder_true_files
import pytest
import os
def test_validate_projectname():
assert validate_projectname("helloWorld") == True
assert validate_projectname("hello_World") == True
assert validate_projectname("hello-world") == True
assert validate_projectname("helloWorld_01") == True
assert validate_projectname("helloWorld.01") == True
assert validate_projectname("hello world") == False
assert validate_projectname("hello&world") == False
assert validate_projectname("he!llo?world") == False
def test_validate_path():
assert validate_path("./subfolder/") == True
assert validate_path("../subfolder/") == True
assert validate_path(".../subfolder/") == False
assert validate_path("subfolder/") == True
assert validate_path(".././subfolder/") == False
assert validate_path("././subfolder/") == False
assert validate_path("././subfolder&something/") == False
assert validate_path("sub_folder/") == True
assert validate_path("sub-folder/") == True
assert validate_path("sub.folder/") == True
def test_has_folder_true_files():
arr_pages = [
[ "_home.scss", False, False],
[ "_contact.scss", False, False ]
]
arr_abstracts = [
[ "_variables.scss", True, True, "var" ],
[ "_functions.scss", False, True, "func" ],
[ "_mixins.scss", True, True, "mix" ],
[ "_placeholders.scss", False, True, "plc" ]
]
assert has_folder_true_files(arr_pages) == False
assert has_folder_true_files(arr_abstracts) == True