Exemple #1
0
 def test_get_subclass(self):
     with self.assertRaises(RuntimeError):
         MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6),
             None, None, None)
     self.assertIsInstance(
         MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6),
             -1, None, None),
         MemberBits.__class__)
Exemple #2
0
def test_get_subclass(Ints):  # noqa: N803
    assert isinstance(
        MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), -1, None, None),
        MemberBits.__class__)
Exemple #3
0
def test_get_subclass_invalid_id(Ints):  # noqa: N803
    with pytest.raises(RuntimeError, match=r'non-integer id'):
        MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), None, None, None)
Exemple #4
0
def test_get_subclass(Ints):  # noqa: N803
    assert isinstance(
        MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), -1, None, None),
        MemberBits.__class__)
Exemple #5
0
def test_get_subclass_invalid_id(Ints):  # noqa: N803
    with pytest.raises(RuntimeError, match=r'non-integer id'):
        MemberBits._get_subclass('Ints', (1, 2, 3, 4, 5, 6), None, None, None)