ppf/new: Add skeleton tests to test_util.py.
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 26 Aug 2011 11:37:32 +0000 (14:37 +0300)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Fri, 26 Aug 2011 11:37:32 +0000 (14:37 +0300)
ppf/new/tests/test_util.py

index ec03e2b..f5a2ea9 100644 (file)
@@ -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()