def topic(self): redis = mock() # when a pipeline is requested, just return ourselves when(redis).pipeline(transaction=mockito_any()).thenReturn(redis) backend = RedisBackend(redis) self.manipulate_backend(backend) return redis
def should_set_event_time(self, redis): verify(redis).hset('hack_times', 'test_hack.test_event', mockito_any())
def test_time(self): when(self.p._msg).getnext().thenReturn("@time") when(self.console).formatTime(mockito_any()).thenReturn("f00") with patch.object(self.console, "say") as say_mock: self.p.adv() say_mock.assert_has_calls([call('^2Time: ^3f00')])