예제 #1
0
    def test_delft3dgt_pulse(self, mockCall):
        """
        Assert that de delft3dgt_pulse task
        calls the containersync_sceneupdate() function.
        """

        delft3dgt_pulse.delay()
        mockCall.assert_called_with('containersync_sceneupdate')
예제 #2
0
    def test_delft3dgt_pulse(self, mockredis, mockcall):
        """
        Assert that de delft3dgt_pulse task
        calls the containersync_sceneupdate() function.
        """
        fake = FakeStrictRedis()
        mockredis.return_value = fake

        delft3dgt_pulse.delay()
        mockcall.assert_called_with('containersync_sceneupdate')
예제 #3
0
    def test_delft3dgt_pulse(self, mockCall):
        """
        Assert that de delft3dgt_pulse task
        calls the containersync_sceneupdate() only once.
        """
        delft3dgt_pulse.delay()

        # Set redis key with TTL 100 seconds from now
        # so subsequent tasks won't run
        self.redis.set('qo_delft3dcontainermanager.tasks.delft3dgt_pulse',
                       int(time()) + 100)

        delft3dgt_pulse.delay()
        delft3dgt_pulse.delay()

        mockCall.assert_called_with('containersync_sceneupdate')
        self.assertEqual(mockCall.call_count, 1)
예제 #4
0
    def test_delft3dgt_pulse(self, mockredis, mockcall):
        """
        Assert that de delft3dgt_pulse task
        calls the containersync_sceneupdate() only once.
        """

        delft3dgt_pulse.delay()

        # Fakeredis stores at module level
        fake = FakeStrictRedis()
        # Set redis key with TTL 100 seconds from now
        # so subsequent tasks won't run
        fake.set('qo_delft3dcontainermanager.tasks.delft3dgt_pulse',
                 int(time()) + 100)

        delft3dgt_pulse.delay()
        delft3dgt_pulse.delay()

        mockcall.assert_called_with('containersync_sceneupdate')
        self.assertEqual(mockcall.call_count, 1)