def test_place_offer(self): self.mb = market.get_balance self.logger = Logger.log self.put = market.put_ask Logger.log = MagicMock() market.get_balance = MagicMock(return_value=56) market.put_ask = MagicMock() cloudomate.place_offer(5, PlebNetConfig()) market.put_ask.assert_called_once() market.get_balance = self.mb Logger.log = self.logger market.put_ask = self.put
def test_place_offer(self): self.mb = market.get_balance self.logger = Logger.log self.put = market.put_ask self.true_settings = plebnet_settings.Init.wallets_testnet Logger.log = MagicMock() market.get_balance = MagicMock(return_value=56) market.put_ask = MagicMock() plebnet_settings.Init.wallets_testnet = MagicMock(return_value=False) cloudomate.place_offer(5, PlebNetConfig()) market.put_ask.assert_called_once() market.get_balance = self.mb Logger.log = self.logger market.put_ask = self.put
def test_place_offer_zero_mb(self): self.mb = market.get_balance self.logger = Logger.log Logger.log = MagicMock() market.get_balance = MagicMock(return_value=0) self.assertFalse(cloudomate.place_offer(5, PlebNetConfig())) market.get_balance = self.mb Logger.log = self.logger