Exemple #1
0
	def testDelete(self):
		""" Try deleting an object via parent.delete(childname) """
		attrs = py_test_object.copy()
		#This is tested above FIXME fully separate these two tests
		self.lmap.foo = lmap(attrs)
		self.lmap.foo._cached_children = {}
		del self.lmap.foo
		self.lmap.commit()
		self.ldap.delete.assert_called_with('ou=foo,'+BASE_DN)
Exemple #2
0
 def testDelete(self):
     """ Try deleting an object via parent.delete(childname) """
     attrs = py_test_object.copy()
     #This is tested above FIXME fully separate these two tests
     self.lmap.foo = lmap(attrs)
     self.lmap.foo._cached_children = {}
     del self.lmap.foo
     self.lmap.commit()
     self.ldap.delete.assert_called_with('ou=foo,' + BASE_DN)
Exemple #3
0
	def setUp(self):
		#super(self, SlapdLmapTest).setUp(self)
		self.ldap = mock.Mock(spec=ldap)
		res = py_test_object.copy()
		self.ldap.search.return_value = [(res['dn'], res)]
		self.lmap = lmap(py_test_object.copy(), BASE_DN, self.ldap)
Exemple #4
0
	def testAdd(self):
		""" Add an object and see whether the data ends up in the database """
		attrs = py_test_object
		self.lmap.foo = lmap(attrs)
		self.lmap.commit()
		self.ldap.add.assert_called_with('ou=foo,'+BASE_DN, attrs)
Exemple #5
0
 def testAdd(self):
     """ Add an object and see whether the data ends up in the database """
     attrs = py_test_object
     self.lmap.foo = lmap(attrs)
     self.lmap.commit()
     self.ldap.add.assert_called_with('ou=foo,' + BASE_DN, attrs)
Exemple #6
0
 def setUp(self):
     #super(self, SlapdLmapTest).setUp(self)
     self.ldap = mock.Mock(spec=ldap)
     res = py_test_object.copy()
     self.ldap.search.return_value = [(res['dn'], res)]
     self.lmap = lmap(py_test_object.copy(), BASE_DN, self.ldap)