def test_stub_bindlink(self): # Remember the starting atomspace size. This test should not # change the atomspace. starting_size = self.atomspace.size() # Run bindlink. atom = stub_bindlink(self.atomspace, self.bindlink_atom) self.assertTrue(atom is not None) # Check the ending atomspace size, it should be the same. ending_size = self.atomspace.size() self.assertEquals(ending_size, starting_size)
def test_stub_bindlink(self): # Remember the starting atomspace size. This test should not # change the atomspace. starting_size = self.atomspace.size() # Run bindlink. result = stub_bindlink(self.atomspace, self.bindlink_handle) self.assertTrue(result is not None and result.value() > 0) # Check the ending atomspace size, it should be the same. ending_size = self.atomspace.size() self.assertEquals(ending_size, starting_size)
def test_stub_bindlink(self): # Remember the starting atomspace size. This test should not # change the atomspace. starting_size = self.atomspace.size() # Run bindlink. atom = stub_bindlink(self.atomspace, self.bindlink_atom) self.assertTrue(atom is not None and atom.value() > 0) # Check the ending atomspace size, it should be the same. ending_size = self.atomspace.size() self.assertEquals(ending_size, starting_size)
InheritanceLink( VariableNode("$var"), ConceptNode("animal")), # The grounding to be returned. VariableNode("$var") # Bindlink needs a handle, not an atom. ).h # Remember the starting atomspace size. This test should not # change the atomspace. starting_size = atomspace.size() # Run bindlink. result = stub_bindlink(atomspace, bindlink_handle) assert_true(result is not None and result.value() > 0) # Check the ending atomspace size, it should be the same. ending_size = atomspace.size() assert_equals(ending_size, starting_size) # Remember the starting atomspace size. starting_size = atomspace.size() # Run bindlink. result = bindlink(atomspace, bindlink_handle) assert_true(result is not None and result.value() > 0) # Check the ending atomspace size, it should have added one SetLink. ending_size = atomspace.size()
InheritanceLink( VariableNode("$var"), ConceptNode("animal")), # The grounding to be returned. VariableNode("$var") # Bindlink needs a handle, not an atom. ) # Remember the starting atomspace size. This test should not # change the atomspace. starting_size = atomspace.size() # Run bindlink. result = stub_bindlink(atomspace, bindlink_atom) assert_true(result is not None) # Check the ending atomspace size, it should be the same. ending_size = atomspace.size() assert_equals(ending_size, starting_size) # Remember the starting atomspace size. starting_size = atomspace.size() # Run bindlink. result = bindlink(atomspace, bindlink_atom) assert_true(result is not None) # Check the ending atomspace size, it should have added one SetLink. ending_size = atomspace.size()
def test_stub_bindlink(atomspace, prep_atom): n = 100000 for i in xrange(n): result = stub_bindlink(atomspace, prep_atom) return n
ConceptNode("animal") ), # The grounding to be returned. VariableNode("$var") ) # Bindlink needs a handle, not an atom. ).h # Remember the starting atomspace size. This test should not # change the atomspace. starting_size = atomspace.size() # Run bindlink. result = stub_bindlink(atomspace, bindlink_handle) assert_true(result is not None and result.value() > 0) # Check the ending atomspace size, it should be the same. ending_size = atomspace.size() assert_equals(ending_size, starting_size) # Remember the starting atomspace size. starting_size = atomspace.size() # Run bindlink. result = bindlink(atomspace, bindlink_handle) assert_true(result is not None and result.value() > 0) # Check the ending atomspace size, it should have added one SetLink. ending_size = atomspace.size()