Skip to content

Commit

Permalink
fleshed out test_start_web_controller; reworks test_test_untrained to…
Browse files Browse the repository at this point in the history
… use proper training format
  • Loading branch information
Tom O'Hara committed Nov 4, 2023
1 parent da3420d commit c09e8a4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mezcla/tests/test_text_categorizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ def test_format_index_html(self):
def test_start_web_controller(self):
"""Ensure start_web_controller works as expected"""
debug.trace(4, "test_start_web_controller()")
assert(False)
TODO_MODEL = "todo.model"
wc = THE_MODULE.start_web_controller(TODO_MODEL, nonblocking=True)
html_listing = wc.index()
assert("</html>" in html_listing)
## TODO2: wc.stop()
debug.trace(4, "out test_start_web_controller")

class TestTextCategorizerScript(TestWrapper):
"""Class for main testcase definition"""
Expand All @@ -114,7 +119,11 @@ def test_test_untrained(self):
"""Make sure accuracy 0 if untrained (TODO: trap stderr)"""
debug.trace(4, "test_test_untrained()")
tc = THE_MODULE.TextCategorizer()
accuracy = tc.test(__file__)
## OLD: accuracy = tc.test(__file__)
test_data = ["cat1\ta b c d e",
"cat2\tf g h i j"]
gh.write_lines(self.temp_file, test_data)
accuracy = tc.test(self.temp_file)
assert(accuracy == 0)

@trap_exception
Expand Down

0 comments on commit c09e8a4

Please sign in to comment.