Example #1
0
  def testDestroySynapse(self):
    # empty connections, create segment seg and a synapse syn
    co = Connections(NUM_CELLS, 0.51)
    seg = co.createSegment(NUM_CELLS-1, 1)
    syn1 = co.createSynapse(seg, NUM_CELLS-1, 0.52)

    # destroy the synapse
    co.destroySynapse(syn1)
    self.assertEqual(co.numSynapses(), 0)
Example #2
0
    def testDestroySynapse(self):
        # empty connections, create segment seg and a synapse syn
        co = Connections(NUM_CELLS, 0.51)
        seg = co.createSegment(NUM_CELLS - 1, 1)
        syn1 = co.createSynapse(seg, NUM_CELLS - 1, 0.52)

        # destroy the synapse
        co.destroySynapse(syn1)
        self.assertEqual(co.numSynapses(), 0)

        with pytest.raises(
                RuntimeError
        ):  # NTA_CHECK, data for removed synapse must not be accessible!
            permRemoved = co.permanenceForSynapse(syn1)
            assert permRemoved == perm1

        # double remove should be just ignored
        co.destroySynapse(syn1)