def test_get_talk__0(self): from randtalkbot.talk import StrangerService stranger_service = StrangerService.get_instance.return_value stranger_service.get_cached_stranger.side_effect = [self.stranger_2, self.stranger_3, ] talk = Talk.get_talk(self.stranger_0) self.assertEqual(talk, self.talk_0) self.assertEqual(talk.partner1, self.stranger_2) self.assertEqual(talk.partner2, self.stranger_3)
def test_get_talk__0(self): from randtalkbot.talk import StrangerService stranger_service = StrangerService.get_instance.return_value stranger_service.get_cached_stranger.side_effect = [ self.stranger_2, self.stranger_3, ] talk = Talk.get_talk(self.stranger_0) self.assertEqual(talk, self.talk_0) self.assertEqual(talk.partner1, self.stranger_2) self.assertEqual(talk.partner2, self.stranger_3)
def test_get_talk__1(self): self.assertEqual(Talk.get_talk(self.stranger_1), self.talk_0) self.assertEqual(Talk.get_talk(self.stranger_2), self.talk_1) self.assertEqual(Talk.get_talk(self.stranger_3), self.talk_1) self.assertEqual(Talk.get_talk(self.stranger_4), None)