File: test_neovi.py

package info (click to toggle)
python-can 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,372 kB
  • sloc: python: 25,840; makefile: 38; sh: 20
file content (26 lines) | stat: -rw-r--r-- 591 bytes parent folder | download
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
#!/usr/bin/env python

"""
"""
import pickle
import unittest

from can.interfaces.ics_neovi import ICSApiError


class ICSApiErrorTest(unittest.TestCase):
    def test_error_pickling(self):
        iae = ICSApiError(
            0xF00,
            "description_short",
            "description_long",
            severity=ICSApiError.ICS_SPY_ERR_CRITICAL,
            restart_needed=1,
        )
        pickled_iae = pickle.dumps(iae)
        un_pickled_iae = pickle.loads(pickled_iae)
        assert iae.__dict__ == un_pickled_iae.__dict__


if __name__ == "__main__":
    unittest.main()