Пример #1
0
class TestNoneOf(unittest.TestCase):
    def setUp(self):
        self.n = NoneOf(UBInt8("foo"), [4, 5, 6, 7])

    def test_trivial(self):
        pass

    def test_parse(self):
        self.assertEqual(self.n.parse(six.b("\x08")), 8)

    def test_parse_invalid(self):
        self.assertRaises(ValidationError, self.n.parse, six.b("\x06"))
Пример #2
0
class TestNoneOf(unittest.TestCase):

    def setUp(self):
        self.n = NoneOf(UBInt8("foo"), [4, 5, 6, 7])

    def test_trivial(self):
        pass

    def test_parse(self):
        self.assertEqual(self.n.parse("\x08"), 8)

    def test_parse_invalid(self):
        self.assertRaises(ValidationError, self.n.parse, "\x06")
Пример #3
0
 def setUp(self):
     self.n = NoneOf(UBInt8("foo"), [4, 5, 6, 7])
Пример #4
0
 def setUp(self):
     self.n = NoneOf(UBInt8("foo"), [4, 5, 6, 7])