def test_join_thread(self): """Should join the associated thread and return True""" r = Response() r.thread = MagicMock() self.assertTrue(r.join()) self.assertEqual(1, r.thread.join.call_count)
def test_join_nothing(self): """Should do nothing and return if no thread exists""" r = Response() self.assertFalse(r.join())