forked from docs/doc-exports
Compare commits
1 Commits
main
...
unit-tests
Author | SHA1 | Date | |
---|---|---|---|
088d6a6daf |
2
.gitignore
vendored
2
.gitignore
vendored
@ -134,6 +134,8 @@ dmypy.json
|
||||
**/temp/
|
||||
**/tmp_result/
|
||||
|
||||
.stestr/
|
||||
|
||||
# Some people build submodule because of not understanding git basics
|
||||
doc-exports
|
||||
|
||||
|
3
.stestr.conf
Normal file
3
.stestr.conf
Normal file
@ -0,0 +1,3 @@
|
||||
[DEFAULT]
|
||||
test_path=./otc_doc_convertor/tests/unit
|
||||
top_dir=./
|
@ -109,7 +109,7 @@ class OTCDocConvertor:
|
||||
"Cannot find string for rawization anymore"
|
||||
)
|
||||
|
||||
def streamline_html(self, soup, file_name):
|
||||
def streamline_html(self, soup, file_name, args=None):
|
||||
# Drop eventual header duplicated anchors
|
||||
fname = file_name.replace(".html", "").lower()
|
||||
page_anchors = set()
|
||||
@ -227,7 +227,7 @@ class OTCDocConvertor:
|
||||
if th.p.strong:
|
||||
th.p.strong.unwrap()
|
||||
|
||||
if self.args.improve_table_headers:
|
||||
if args and args.improve_table_headers:
|
||||
# Add spaces around "/"
|
||||
for th in soup.body.find_all("th"):
|
||||
if hasattr(th, "p") and th.p.string:
|
||||
@ -562,7 +562,7 @@ class OTCDocConvertor:
|
||||
content = re.sub(r"≤", "<=", content)
|
||||
content = re.sub(r"≥", ">=", content)
|
||||
soup = bs4.BeautifulSoup(content, "lxml")
|
||||
proc = self.streamline_html(soup, f.name)
|
||||
proc = self.streamline_html(soup, f.name, self.args)
|
||||
|
||||
for lnk in proc.find_all("a"):
|
||||
href = lnk.get("href")
|
||||
|
0
otc_doc_convertor/tests/unit/__init__.py
Normal file
0
otc_doc_convertor/tests/unit/__init__.py
Normal file
165
otc_doc_convertor/tests/unit/test_convertor.py
Normal file
165
otc_doc_convertor/tests/unit/test_convertor.py
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user