-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtests.py
31 lines (20 loc) · 845 Bytes
/
tests.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
import os
import shutil
TEST_OUTPUT_PATH = "_testoutput"
TEST_REPO_PATH = "_testrepos"
theme_dir = 'themes/centraldedados/'
def setup_module():
from datacentral import generate
generate(False, False, TEST_OUTPUT_PATH, theme_dir, TEST_REPO_PATH)
def teardown_module():
shutil.rmtree(TEST_OUTPUT_PATH)
shutil.rmtree(TEST_REPO_PATH)
def test_output_dir_created():
assert os.path.exists(TEST_OUTPUT_PATH)
def test_api_created():
assert os.path.exists(os.path.join(TEST_OUTPUT_PATH, 'api.json'))
def test_staticfiles_created():
# only checks for one file in each asset dir, lazy :p
assert os.path.exists(os.path.join(TEST_OUTPUT_PATH, 'css/main.css'))
assert os.path.exists(os.path.join(TEST_OUTPUT_PATH, 'js/search.js'))
assert os.path.exists(os.path.join(TEST_OUTPUT_PATH, 'img/ajax-loader.gif'))