-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtest_filetree.py
36 lines (26 loc) · 1.28 KB
/
test_filetree.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
import mobase
import mobase_tests.filetree as m
def test_filetype():
FT = mobase.FileTreeEntry.FileTypes
assert mobase.FileTreeEntry.FILE == FT.FILE
assert m.is_file(FT.FILE)
assert not m.is_directory(FT.FILE)
assert m.value(FT.FILE) == FT.FILE.value
assert mobase.FileTreeEntry.DIRECTORY == FT.DIRECTORY
assert not m.is_file(FT.DIRECTORY)
assert m.is_directory(FT.DIRECTORY)
assert m.value(FT.DIRECTORY) == FT.DIRECTORY.value
assert mobase.FileTreeEntry.FILE_OR_DIRECTORY == FT.FILE_OR_DIRECTORY
assert m.is_file(FT.FILE_OR_DIRECTORY)
assert m.is_directory(FT.FILE_OR_DIRECTORY)
assert m.value(FT.FILE_OR_DIRECTORY) == FT.FILE_OR_DIRECTORY.value
assert FT.FILE_OR_DIRECTORY == FT.FILE | FT.DIRECTORY
assert m.is_file(FT.FILE | FT.DIRECTORY)
assert m.is_directory(FT.FILE | FT.DIRECTORY)
assert m.value(FT.FILE | FT.DIRECTORY) == (FT.FILE.value | FT.DIRECTORY.value)
assert m.is_file(FT.FILE_OR_DIRECTORY & FT.FILE)
assert not m.is_directory(FT.FILE_OR_DIRECTORY & FT.FILE)
assert not m.is_file(FT.FILE_OR_DIRECTORY & FT.DIRECTORY)
assert m.is_directory(FT.FILE_OR_DIRECTORY & FT.DIRECTORY)
assert m.is_file(FT.FILE_OR_DIRECTORY & ~FT.DIRECTORY)
assert not m.is_directory(FT.FILE_OR_DIRECTORY & ~FT.DIRECTORY)