示例#1
0
    def test_when_valid_coords_does_not_raise(self, coords_values: tuple):
        # 1. Set up test model
        coords = coords_values
        properties = None
        mask_point = None

        # 2. Do test
        try:
            mask_point = MaskOutputFile.create_mask_point(coords, properties)
        except:
            pytest.fail("Exception risen but not expected.")
        # 3. Verify final expectations
        assert mask_point is not None, "" + "No mask_point generated"
示例#2
0
    def test_when_no_properties_does_not_raise(self):
        # 1. Set up test model
        coords = (4.2, 2.4)
        properties = None
        mask_point = None
        # 2. Set up initial expectations

        # 3. Do test
        try:
            mask_point = MaskOutputFile.create_mask_point(coords, properties)
        except:
            pytest.fail("Exception risen but not expected.")
        # 4. Verify final expectations
        assert mask_point is not None, "" + "No mask_point generated"
示例#3
0
    def test_when_invalid_coords_raises(self, coords_values: tuple):
        # 1. Set up test model
        coords = coords_values
        properties = None
        mask_point = None
        exception_thrown = False
        # 2. Do test
        try:
            mask_point = MaskOutputFile.create_mask_point(coords, properties)
        except:
            exception_thrown = True

        # 3. Verify final expectations
        assert exception_thrown, "" + "No exception was thrown but it was expected."
        assert mask_point is None, "" + "Mask point generated but was not expected."