def test_protected_static_property(): """Test protected static properties.""" ob = PropertyTest() assert PropertyTest.ProtectedStaticProperty == 0 PropertyTest.ProtectedStaticProperty = 1 assert PropertyTest.ProtectedStaticProperty == 1 assert ob.ProtectedStaticProperty == 1 ob.ProtectedStaticProperty = 0 assert ob.ProtectedStaticProperty == 0 with pytest.raises(TypeError): del PropertyTest.ProtectedStaticProperty with pytest.raises(TypeError): del PropertyTest().ProtectedStaticProperty
def test_protected_static_property(self): """Test protected static properties.""" ob = PropertyTest() self.assertTrue(PropertyTest.ProtectedStaticProperty == 0) PropertyTest.ProtectedStaticProperty = 1 self.assertTrue(PropertyTest.ProtectedStaticProperty == 1) self.assertTrue(ob.ProtectedStaticProperty == 1) ob.ProtectedStaticProperty = 0 self.assertTrue(ob.ProtectedStaticProperty == 0) with self.assertRaises(TypeError): del PropertyTest.ProtectedStaticProperty with self.assertRaises(TypeError): del PropertyTest().ProtectedStaticProperty
def testProtectedStaticProperty(self): """Test protected static properties.""" object = PropertyTest() self.failUnless(PropertyTest.ProtectedStaticProperty == 0) PropertyTest.ProtectedStaticProperty = 1 self.failUnless(PropertyTest.ProtectedStaticProperty == 1) self.failUnless(object.ProtectedStaticProperty == 1) object.ProtectedStaticProperty = 0 self.failUnless(object.ProtectedStaticProperty == 0) def test(): del PropertyTest.ProtectedStaticProperty self.failUnlessRaises(TypeError, test) def test(): del PropertyTest().ProtectedStaticProperty self.failUnlessRaises(TypeError, test)
def testProtectedStaticProperty(self): """Test protected static properties.""" object = PropertyTest(); self.failUnless(PropertyTest.ProtectedStaticProperty == 0) PropertyTest.ProtectedStaticProperty = 1 self.failUnless(PropertyTest.ProtectedStaticProperty == 1) self.failUnless(object.ProtectedStaticProperty == 1) object.ProtectedStaticProperty = 0 self.failUnless(object.ProtectedStaticProperty == 0) def test(): del PropertyTest.ProtectedStaticProperty self.failUnlessRaises(TypeError, test) def test(): del PropertyTest().ProtectedStaticProperty self.failUnlessRaises(TypeError, test)
def testProtectedStaticProperty(self): """Test protected static properties.""" object = PropertyTest(); self.assertTrue(PropertyTest.ProtectedStaticProperty == 0) PropertyTest.ProtectedStaticProperty = 1 self.assertTrue(PropertyTest.ProtectedStaticProperty == 1) self.assertTrue(object.ProtectedStaticProperty == 1) object.ProtectedStaticProperty = 0 self.assertTrue(object.ProtectedStaticProperty == 0) def test(): del PropertyTest.ProtectedStaticProperty self.assertRaises(TypeError, test) def test(): del PropertyTest().ProtectedStaticProperty self.assertRaises(TypeError, test)