Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
 def should_set_event_time(self, redis):
     verify(redis).hset('hack_times', 'test_hack.test_event', mockito_any())
Exemplo n.º 4
0
 def should_set_event_time(self, redis):
     verify(redis).hset('hack_times', 'test_hack.test_event',
                        mockito_any())
Exemplo n.º 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')])
Exemplo n.º 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')])