Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 def should_set_event_time(self, redis):
     verify(redis).hset('hack_times', 'test_hack.test_event', mockito_any())
Beispiel #4
0
 def should_set_event_time(self, redis):
     verify(redis).hset('hack_times', 'test_hack.test_event',
                        mockito_any())
Beispiel #5
0
 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')])
Beispiel #6
0
 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')])