Robot Framework
create_testdoc_data.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 import sys
4 from os.path import abspath, dirname, join, normpath
5 import shutil
6 
7 BASE = dirname(abspath(__file__))
8 ROOT = normpath(join(BASE, '..', '..', '..', '..'))
9 DATA = [join(ROOT, 'atest', 'testdata', 'misc'), join(BASE, 'dir.suite')]
10 SRC = join(ROOT, 'src')
11 # must generate data next to testdoc.html to get relative sources correct
12 OUTPUT = join(BASE, '..', 'testdoc.js')
13 REAL_OUTPUT = join(BASE, 'testdoc.js')
14 
15 sys.path.insert(0, SRC)
16 
17 from robot.testdoc import TestSuiteFactory, TestdocModelWriter
18 
19 with open(OUTPUT, 'w') as output:
20  TestdocModelWriter(output, TestSuiteFactory(DATA)).write_data()
21 
22 shutil.move(OUTPUT, REAL_OUTPUT)
23 
24 print(REAL_OUTPUT)
25 
def TestSuiteFactory(datasources, **options)
Definition: testdoc.py:131
def abspath(path, case_normalize=False)
Replacement for os.path.abspath with some enhancements and bug fixes.
Definition: robotpath.py:65
def normpath(path, case_normalize=False)
Replacement for os.path.normpath with some enhancements.
Definition: robotpath.py:46