-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_setup_eb.py
58 lines (40 loc) · 1.8 KB
/
test_setup_eb.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
49
50
51
52
53
54
55
56
57
58
import os
import pytest
import setup_eb
def test_setup_eb():
assert isinstance(setup_eb.PACKAGE_NAME, str)
assert os.path.exists(os.path.join(setup_eb.ROOT_DIR, "src", setup_eb.PACKAGE_NAME))
assert isinstance(setup_eb.AUTHOR, str)
assert 'dcic' in setup_eb.AUTHOR.lower()
assert '@' not in setup_eb.AUTHOR
assert isinstance(setup_eb.AUTHOR, str)
assert '@' in setup_eb.AUTHOR_EMAIL
assert isinstance(setup_eb.URL, str)
assert 'http://' in setup_eb.URL
assert isinstance(setup_eb.LICENSE, str)
assert setup_eb.LICENSE
assert isinstance(setup_eb.README, str)
assert '\n' in setup_eb.README
assert isinstance(setup_eb.CHANGES, str)
assert '\n' in setup_eb.CHANGES
assert isinstance(setup_eb.LONG_DESCRIPTION, str)
assert setup_eb.README in setup_eb.LONG_DESCRIPTION
assert setup_eb.CHANGES in setup_eb.LONG_DESCRIPTION
assert isinstance(setup_eb.DESCRIPTION, str)
assert 'dcic' in setup_eb.DESCRIPTION.lower()
assert isinstance(setup_eb.INSTALL_REQUIRES, list)
assert all(isinstance(requirement, str) for requirement in setup_eb.INSTALL_REQUIRES)
assert isinstance(setup_eb.INSTALL_REQUIRES, list)
assert all(isinstance(requirement, str) for requirement in setup_eb.INSTALL_REQUIRES)
assert isinstance(setup_eb.VERSION, str)
assert setup_eb.VERSION[0].isdigit()
assert setup_eb.fix_requirement("1.3.5") == "==1.3.5"
assert setup_eb.fix_requirement("^1.3.5") == ">=1.3.5,<2"
assert setup_eb.fix_requirement("~1.3.5") == ">=1.3.5,<1.4"
if __name__ == '__main__':
# Because this file is not part of the files pytest would find, it has to be run
try:
test_setup_eb()
print("Testing of setup_eb.py SUCCEEDED.")
except Exception as e:
print("Testing of setup_eb.py FAILED:", str(e))