=== added file 'tests/test-watch.py'
--- tests/test-watch.py	1970-01-01 00:00:00 +0000
+++ tests/test-watch.py	2012-07-18 03:55:43 +0000
@@ -0,0 +1,99 @@
+#!/usr/bin/python
+
+import sys, os.path
+sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), "..")))
+
+import unittest
+from lpltk.LaunchpadService import LaunchpadService
+from lpltk.person import *
+
+class TestTags(unittest.TestCase):
+
+    def setUp(self):
+        self.configuration = {}
+        self.configuration['launchpad_services_root'] = 'edge'
+        self.configuration['read_only']               = True
+        self.bug_id = 235643
+
+    def tearDown(self):
+        pass
+
+    def _get_first_watch(self):
+        ls  = LaunchpadService(self.configuration)
+        bug = ls.get_bug(self.bug_id)
+        return bug.bug_watches[0]
+
+    def test_bug(self):
+        bug_watch = self._get_first_watch()
+        self.assertEqual(bug_watch.bug.id, bug.id)
+
+    def test_bug_tasks(self):
+        bug_watch = self._get_first_watch()
+        self.assertEqual(len(bug_watch.bug_tasks), 3)
+
+    def test_date_created(self):
+        bug_watch = self._get_first_watch()
+        self.assertEqual(bug_watch.date_created, "2008-05-28")
+
+    def test_date_last_changed(self):
+        bug_watch = self._get_first_watch()
+        self.assertNotNone(bug_watch.date_last_changed)
+
+    def test_date_last_checked(self):
+        bug_watch = self._get_first_watch()
+        self.assertNotNone(bug_watch.date_last_checked)
+
+    def test_date_next_checked(self):
+        bug_watch = self._get_first_watch()
+        self.assertNotNone(bug_watch.date_next_checked)
+
+    def test_last_error_type(self):
+        bug_watch = self._get_first_watch()
+        self.assertNotNone(bug_watch.last_error_type)
+
+    def test_owner(self):
+        bug_watch = self._get_first_watch()
+        self.assertNotNone(bug_watch.owner)
+        self.assertEqual(bug_watch.owner.name, "aus")
+
+    def test_remote_bug(self):
+        bug_watch = self._get_first_watch()
+
+
+    def test_remote_importance(self):
+        bug_watch = self._get_first_watch()
+
+
+    def test_remote_status(self):
+        bug_watch = self._get_first_watch()
+
+
+    def test_title(self):
+        bug_watch = self._get_first_watch()
+
+
+    def test_url(self):
+        bug_watch = self._get_first_watch()
+
+
+    def test_watch_owner(self):
+        ls  = LaunchpadService(self.configuration)
+        bug = ls.get_bug(self.bug_id)
+
+    def test_containment(self):
+        ls  = LaunchpadService(self.configuration)
+        bug = ls.get_bug(self.bug_id)
+        bug_watches = bug.bug_watches
+
+        # Test containment
+        bug_watch = bug_watches[0]
+        if not bug_watch in bug_watches:
+            raise AssertionError
+        else:
+            print "Located bug watch in collection"
+
+
+if __name__ == '__main__':
+    unittest.main()
+
+# vi:set ts=4 sw=4 expandtab:

