예제 #1
0
    def test_part_without_kind_attribute_will_be_not_in_mapping():
        assert 123 not in PART_MAPPING

        class Part123(Part):
            # No kind attribute
            pass
        assert 123 not in PART_MAPPING
        assert Part123 not in PART_MAPPING.values()
예제 #2
0
파일: test_parts.py 프로젝트: zeozang/PyHDB
    def test_part_without_kind_attribute_will_be_not_in_mapping(self):
        assert 123 not in PART_MAPPING

        class Part123(Part):
            # No kind attribute
            pass
        assert 123 not in PART_MAPPING
        assert Part123 not in PART_MAPPING.values()
예제 #3
0
    def test_part_kind_out_of_range_raises_exception():

        with pytest.raises(InterfaceError):
            class OutOfRangePart(Part):
                kind = 255
            assert OutOfRangePart not in PART_MAPPING.values()
예제 #4
0
파일: test_parts.py 프로젝트: zeozang/PyHDB
    def test_part_kind_out_of_range_raises_exception(self):

        with pytest.raises(InterfaceError):
            class OutOfRangePart(Part):
                kind = 255
            assert OutOfRangePart not in PART_MAPPING.values()