def test_pop(self): """ Test LDAPEntry's pop method. """ entry = LDAPEntry("cn=test") entry['test'] = "test" self.assertRaises(TypeError, entry.pop) self.assertRaises(TypeError, lambda: entry.pop('t', 2, 3)) self.assertRaises(KeyError, lambda: entry.pop('t')) self.assertEqual(entry.pop("test"), ["test"]) self.assertEqual(entry.pop("test", None), None)
def test_pop(): """ Test LDAPEntry's pop method. """ entry = LDAPEntry("cn=test") entry["test"] = "test" with pytest.raises(TypeError): _ = entry.pop() with pytest.raises(TypeError): _ = entry.pop("t", 2, 3) with pytest.raises(KeyError): _ = entry.pop("t") assert entry.pop("test") == ["test"] assert entry.pop("test", None) is None
def test_pop(self): """ Test LDAPEntry's pop method. """ entry = LDAPEntry("cn=test") entry['test'] = "test" self.assertEqual(entry.pop("test"), ["test"]) self.assertEqual(entry.pop("test", None), None)