From 51a264a385c2dd284c4d84b59838a36e660d11fd Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Fri, 26 Aug 2011 14:37:32 +0300 Subject: [PATCH] ppf/new: Add skeleton tests to test_util.py. --- ppf/new/tests/test_util.py | 48 ++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/ppf/new/tests/test_util.py b/ppf/new/tests/test_util.py index ec03e2b..f5a2ea9 100644 --- a/ppf/new/tests/test_util.py +++ b/ppf/new/tests/test_util.py @@ -14,20 +14,16 @@ import sys import util class LiveLogStatusTest(unittest.TestCase): - """ - Test suite for LiveLogStatus class in util.py. - """ + """Test suite for LiveLogStatus class in util.py.""" - def setUp(self): - pass + def test_init(self): + """Class constructor works properly.""" + status = util.LiveLogStatus(12345) - def tearDown(self): - pass + self.assertEqual(status.position, 12345) class LiveLogFileTest(unittest.TestCase): - """ - Test suite for LiveLogFile class in util.py. - """ + """Test suite for LiveLogFile class in util.py.""" def setUp(self): pass @@ -35,5 +31,37 @@ class LiveLogFileTest(unittest.TestCase): def tearDown(self): pass + def test_no_log_file(self): + """No log file is present.""" + self.assertEqual(True, False) + + def test_no_status_file(self): + """No status file is present.""" + self.assertEqual(True, False) + + def test_invalid_content_in_status_file(self): + """Status file contains invalid content (no string).""" + self.assertEqual(True, False) + + def test_no_newline_at_end_of_status_file(self): + """Status file contains invalid content (no string).""" + self.assertEqual(True, False) + + def test_read_one_line_from_log_file(self): + """Read a single line from the log file. + Status information should be updated accordingly. + """ + self.assertEqual(True, False) + + def test_read_two_lines_from_log_file(self): + """Read two lines from the log file. + Status information should be updated accordingly. + """ + self.assertEqual(True, False) + + def test_incomplete_log_file(self): + """Log file's last doesn't end in a new line.""" + self.assertEqual(True, False) + if __name__ == "__main__": unittest.main() -- 2.20.1