Exemplo n.º 1
0
def test_protected_instance_property():
    """Test protected instance properties."""
    ob = PropertyTest()

    assert ob.ProtectedProperty == 0
    ob.ProtectedProperty = 1
    assert ob.ProtectedProperty == 1

    with pytest.raises(TypeError):
        del PropertyTest().ProtectedProperty
Exemplo n.º 2
0
    def test_protected_instance_property(self):
        """Test protected instance properties."""
        ob = PropertyTest()

        self.assertTrue(ob.ProtectedProperty == 0)
        ob.ProtectedProperty = 1
        self.assertTrue(ob.ProtectedProperty == 1)

        with self.assertRaises(TypeError):
            del PropertyTest().ProtectedProperty
Exemplo n.º 3
0
def test_protected_instance_property():
    """Test protected instance properties."""
    ob = PropertyTest()

    assert ob.ProtectedProperty == 0
    ob.ProtectedProperty = 1
    assert ob.ProtectedProperty == 1

    with pytest.raises(TypeError):
        del PropertyTest().ProtectedProperty
Exemplo n.º 4
0
    def testProtectedInstanceProperty(self):
        """Test protected instance properties."""
        object = PropertyTest()

        self.failUnless(object.ProtectedProperty == 0)
        object.ProtectedProperty = 1
        self.failUnless(object.ProtectedProperty == 1)

        def test():
            del PropertyTest().ProtectedProperty

        self.failUnlessRaises(TypeError, test)
Exemplo n.º 5
0
    def testProtectedInstanceProperty(self):
        """Test protected instance properties."""
        object = PropertyTest();

        self.failUnless(object.ProtectedProperty == 0)
        object.ProtectedProperty = 1
        self.failUnless(object.ProtectedProperty == 1)

        def test():
            del PropertyTest().ProtectedProperty

        self.failUnlessRaises(TypeError, test)
Exemplo n.º 6
0
    def testProtectedInstanceProperty(self):
        """Test protected instance properties."""
        object = PropertyTest();

        self.assertTrue(object.ProtectedProperty == 0)
        object.ProtectedProperty = 1
        self.assertTrue(object.ProtectedProperty == 1)

        def test():
            del PropertyTest().ProtectedProperty

        self.assertRaises(TypeError, test)