def test_get_bug_watch_ids(self):
     # get_bug_watch_ids() yields the IDs for the given bug
     # watches.
     bug_watches = [self.factory.makeBugWatch()]
     self.failUnlessEqual(
         [bug_watch.id for bug_watch in bug_watches],
         list(get_bug_watch_ids(bug_watches)))
 def test_get_bug_watch_ids_with_mixed_list(self):
     # get_bug_watch_ids() does the right thing when the given
     # objects are a mix of bug watches and IDs.
     bug_watch = self.factory.makeBugWatch()
     bug_watches = [1234, bug_watch]
     self.failUnlessEqual(
         [1234, bug_watch.id], list(get_bug_watch_ids(bug_watches)))
Example #3
0
 def test_get_bug_watch_ids_with_mixed_list(self):
     # get_bug_watch_ids() does the right thing when the given
     # objects are a mix of bug watches and IDs.
     bug_watch = self.factory.makeBugWatch()
     bug_watches = [1234, bug_watch]
     self.assertEqual([1234, bug_watch.id],
                      list(get_bug_watch_ids(bug_watches)))
 def test_get_bug_watch_ids_with_others_in_list(self):
     # get_bug_watch_ids() asserts that all arguments are bug
     # watches or resemble IDs.
     self.assertRaises(
         AssertionError, list, get_bug_watch_ids(['fred']))
 def test_get_bug_watch_ids_with_id_list(self):
     # If something resembling an ID is found, get_bug_watch_ids()
     # yields it unaltered.
     bug_watches = [1, 2, 3]
     self.failUnlessEqual(
         bug_watches, list(get_bug_watch_ids(bug_watches)))
 def test_get_bug_watch_ids_with_iterator(self):
     # get_bug_watch_ids() can also accept an iterator.
     bug_watches = [self.factory.makeBugWatch()]
     self.failUnlessEqual(
         [bug_watch.id for bug_watch in bug_watches],
         list(get_bug_watch_ids(iter(bug_watches))))
Example #7
0
 def test_get_bug_watch_ids_with_others_in_list(self):
     # get_bug_watch_ids() asserts that all arguments are bug
     # watches or resemble IDs.
     self.assertRaises(AssertionError, list, get_bug_watch_ids(['fred']))
Example #8
0
 def test_get_bug_watch_ids_with_id_list(self):
     # If something resembling an ID is found, get_bug_watch_ids()
     # yields it unaltered.
     bug_watches = [1, 2, 3]
     self.assertEqual(bug_watches, list(get_bug_watch_ids(bug_watches)))
Example #9
0
 def test_get_bug_watch_ids_with_iterator(self):
     # get_bug_watch_ids() can also accept an iterator.
     bug_watches = [self.factory.makeBugWatch()]
     self.assertEqual([bug_watch.id for bug_watch in bug_watches],
                      list(get_bug_watch_ids(iter(bug_watches))))
Example #10
0
 def test_get_bug_watch_ids(self):
     # get_bug_watch_ids() yields the IDs for the given bug
     # watches.
     bug_watches = [self.factory.makeBugWatch()]
     self.assertEqual([bug_watch.id for bug_watch in bug_watches],
                      list(get_bug_watch_ids(bug_watches)))