Skip to content
This repository was archived by the owner on Feb 28, 2019. It is now read-only.

Commit 09bb841

Browse files
committed
fixed the test problem
1 parent 09ad28e commit 09bb841

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

tests/test_cuckoo.py

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
"""docstring"""
2+
import unittest
23
from bs4 import BeautifulSoup
34

45

5-
with open("tests/test_cuckoo.html") as f:
6-
soup = BeautifulSoup(f.read(), 'html.parser')
7-
information = soup.find(id="information")
8-
print("--------------informations--------------")
9-
for ch in information.find(class_="panel-body"):
10-
if len(ch.string.strip()) > 0:
6+
def test_cuckoo():
7+
with open("tests/test_cuckoo.html") as f:
8+
soup = BeautifulSoup(f.read(), 'html.parser')
9+
information = soup.find(id="information")
10+
print("--------------informations--------------")
11+
for ch in information.find(class_="panel-body"):
12+
if len(ch.string.strip()) > 0:
13+
print(ch.string.strip())
14+
all_sig = soup.find(id="signatures")
15+
print("----------------warnings----------------")
16+
for ch in all_sig.find_all("div", class_="alert-warning"):
1117
print(ch.string.strip())
12-
all_sig = soup.find(id="signatures")
13-
print("----------------warnings----------------")
14-
for ch in all_sig.find_all("div", class_="alert-warning"):
15-
print(ch.string.strip())
16-
print("-----------------errors-----------------")
17-
for ch in all_sig.find_all("div", class_="alert-danger"):
18-
print(ch.string.strip())
18+
print("-----------------errors-----------------")
19+
for ch in all_sig.find_all("div", class_="alert-danger"):
20+
print(ch.string.strip())
21+
22+
if __name__ == "__main__":
23+
testcase = unittest.FunctionTestCase(test_cuckoo)
24+
unittest.main()

0 commit comments

Comments
 (0)