File: redis_slave_context.py

package info (click to toggle)
pymodbus 2.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,704 kB
  • sloc: python: 17,594; makefile: 83; sh: 8
file content (29 lines) | stat: -rw-r--r-- 908 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
import unittest
import os
from subprocess import Popen as execute
from pymodbus.datastore.modredis import RedisSlaveContext
from base_context import ContextRunner

class RedisSlaveContextTest(ContextRunner, unittest.TestCase):
    """
    These are the integration tests for using the redis
    slave context.
    """

    def setUp(self):
        """ Initializes the test environment """
        self.context = RedisSlaveContext() # the redis client will block, so no wait needed
        self.initialize("redis-server")

    def tearDown(self):
        """ Cleans up the test environment """
        self.server.kill()
        self.fnull.close()
        self.shutdown()

# --------------------------------------------------------------------------- #
# Main
# --------------------------------------------------------------------------- #
if __name__ == "__main__":
    unittest.main()