def test_set_status(): """ Test setting LDAPValueList's status. """ lvl = LDAPValueList() with pytest.raises(TypeError): lvl.status = "a" with pytest.raises(ValueError): lvl.status = -1 lvl.status = 2 assert lvl.status == 2
def test_set_status(): """ Test setting LDAPValueList's status. """ lvl = LDAPValueList() with pytest.raises(TypeError): lvl.status = "a" with pytest.raises(ValueError): lvl.status = -1 lvl.status = 2 assert lvl.status == 2
def test_set_status(self): """ Test setting LDAPValueList's status. """ lvl = LDAPValueList() def wrong1(): lvl.status = 'a' self.assertRaises(TypeError, wrong1) def wrong2(): lvl.status = -1 self.assertRaises(ValueError, wrong2) lvl.status = 2 self.assertEqual(lvl.status, 2)
def test_set_status(self): """ Test setting LDAPValueList's status. """ lvl = LDAPValueList() def wrong1(): lvl.status = 'a' self.assertRaises(TypeError, wrong1) def wrong2(): lvl.status = -1 self.assertRaises(ValueError, wrong2) lvl.status = 2 self.assertEqual(lvl.status, 2)