Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
    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)
Пример #4
0
            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()
Пример #5
0
            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()
Пример #6
0
            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()
Пример #7
0
def test_stub_bindlink(atomspace, prep_atom):
    n = 100000
    for i in xrange(n):
        result = stub_bindlink(atomspace, prep_atom)
    return n
Пример #8
0
                    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()
Пример #9
0
def test_stub_bindlink(atomspace, prep_atom):
    n = 100000
    for i in xrange(n):
        result = stub_bindlink(atomspace, prep_atom)
    return n