def test_matchmakers_error(self): self.requests = requests.get requests.get = MagicMock(side_effect=requests.ConnectionError) self.assertEquals(Market.match_makers(), "Unable to retrieve amount of ") requests.get = self.requests
def msg_match_makers(self): self.send_msg("I currently have: %s matchmakers" % market_controller.match_makers())
def test_matchmakers(self): responses.add(responses.GET, 'http://localhost:8085/market/matchmakers', json={'matchmakers': ['test1', 'test2', 'test3']}) self.assertEqual(Market.match_makers(), 3)
def msg_match_makers(self): self.send_msg("I currently have: %s matchmakers" % market_controller.match_makers()) def msg_uploaded(self): self.send_msg("I currently have uploaded: %s MB" % tribler_controller.get_uploaded())