mockredis.tests.fixtures.assert_raises_redis_error

Here are the examples of the python api mockredis.tests.fixtures.assert_raises_redis_error taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

Example 1

Project: mockredis
Source File: test_pipeline.py
View license
    def test_watch_after_multi(self):
        """
        Cannot watch after multi.
        """
        with self.redis.pipeline() as pipeline:
            pipeline.multi()
            with assert_raises_redis_error():
                pipeline.watch()

Example 2

Project: mockredis
Source File: test_pipeline.py
View license
    def test_multiple_multi_calls(self):
        """
        Cannot call multi mutliple times.
        """
        with self.redis.pipeline() as pipeline:
            pipeline.multi()
            with assert_raises_redis_error():
                pipeline.multi()

Example 3

Project: mockredis
Source File: test_pipeline.py
View license
    def test_multi_on_implicit_transaction(self):
        """
        Cannot start an explicit transaction when commands have already been issued.
        """
        with self.redis.pipeline() as pipeline:
            pipeline.set("foo", "bar")
            with assert_raises_redis_error():
                pipeline.multi()

Example 4

Project: mockredis
Source File: test_pipeline.py
View license
    def test_watch_after_multi(self):
        """
        Cannot watch after multi.
        """
        with self.redis.pipeline() as pipeline:
            pipeline.multi()
            with assert_raises_redis_error():
                pipeline.watch()

Example 5

Project: mockredis
Source File: test_pipeline.py
View license
    def test_multiple_multi_calls(self):
        """
        Cannot call multi mutliple times.
        """
        with self.redis.pipeline() as pipeline:
            pipeline.multi()
            with assert_raises_redis_error():
                pipeline.multi()

Example 6

Project: mockredis
Source File: test_pipeline.py
View license
    def test_multi_on_implicit_transaction(self):
        """
        Cannot start an explicit transaction when commands have already been issued.
        """
        with self.redis.pipeline() as pipeline:
            pipeline.set("foo", "bar")
            with assert_raises_redis_error():
                pipeline.multi()