File: test_config.py

package info (click to toggle)
python-umodbus 1.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 456 kB
  • sloc: python: 1,944; makefile: 166; sh: 5
file content (14 lines) | stat: -rw-r--r-- 611 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class TestConfig:
    def test_defaults(self, config):
        """ Test whether defaults configuration values are correct. """
        assert config.SINGLE_BIT_VALUE_FORMAT_CHARACTER == 'B'
        assert config.MULTI_BIT_VALUE_FORMAT_CHARACTER == 'H'
        assert not config.SIGNED_VALUES

    def test_multi_bit_value_signed(self, config):
        """  Test if MULTI_BIT_VALUE_FORMAT_CHARACTER changes when setting
        signedness.
        """
        assert config.MULTI_BIT_VALUE_FORMAT_CHARACTER == 'H'
        config.SIGNED_VALUES = True
        assert config.MULTI_BIT_VALUE_FORMAT_CHARACTER == 'h'