forked from simpeg/simpeg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_docs.py
35 lines (26 loc) · 861 Bytes
/
test_docs.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
import subprocess
import unittest
import os
import subprocess
import unittest
import os
class Doc_Test(unittest.TestCase):
@property
def path_to_docs(self):
dirname, filename = os.path.split(os.path.abspath(__file__))
return dirname.split(os.path.sep)[:-2] + ['docs']
def test_html(self):
wd = os.getcwd()
os.chdir(os.path.sep.join(self.path_to_docs))
response = subprocess.run(["make", "html"])
self.assertTrue(response.returncode == 0)
os.chdir(wd)
# def test_linkcheck(self):
# wd = os.getcwd()
# os.chdir(os.path.sep.join(self.path_to_docs))
# response = subprocess.run(["make", "linkcheck"])
# print(response.returncode)
# self.assertTrue(response.returncode == 0)
# os.chdir(wd)
if __name__ == '__main__':
unittest.main()