Conditions | 3 |
Total Lines | 19 |
Lines | 19 |
Ratio | 100 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | #!/usr/bin/env python3 |
||
28 | def test_not_valid(self): |
||
29 | """Test field formats that are not valid ElementBase elements.""" |
||
30 | |||
31 | test_fields = [ |
||
32 | ('a', '4x'), # 4 pad bytes |
||
33 | ('b', 'z'), # invalid |
||
34 | ('c', '1'), # invalid |
||
35 | ('d', '9S'), # invalid (must be lowercase) |
||
36 | ('e', 'b'), # signed byte: -128, 127 |
||
37 | ('f', 'H'), # unsigned short: 0, 65535 |
||
38 | ('g', '10s'), # 10 byte string |
||
39 | ('h', 'L'), # unsigned long: 0, 2^32-1 |
||
40 | ('i', '/'), # invalid |
||
41 | ] |
||
42 | |||
43 | for field in test_fields: |
||
44 | with self.subTest(field): # pylint: disable=no-member |
||
45 | out = ElementBase.valid(field) |
||
46 | self.assertFalse(out) |
||
47 |