Esempio n. 1
0
    def test_BeginEndSubnet(self):
        """Begin/End Subnet"""

        nest.ResetKernel()

        nest.BeginSubnet()
        sn = nest.EndSubnet()

        nest.BeginSubnet(label='testlabel')
        sn = nest.EndSubnet()

        self.assertEqual(nest.GetStatus(sn, 'label')[0], 'testlabel')
Esempio n. 2
0
    def test_GetNetwork(self):
        """GetNetwork"""

        nest.ResetKernel()
        nest.BeginSubnet(label='subnet1')
        nest.BeginSubnet(label='subnet2')

        n = nest.Create('iaf_psc_alpha', 100)
        sn2 = nest.EndSubnet()
        sn1 = nest.EndSubnet()

        self.assertEqual(nest.CurrentSubnet(), (0, ))
        self.assertEqual(nest.GetNetwork(sn1, 1)[1], sn2[0])
        self.assertEqual(len(nest.GetNetwork(sn1, 2)[1]), len(
            nest.GetNetwork(sn2, 1)))
Esempio n. 3
0
    def test_CurrentSubnet(self):
        """Current Subnet"""

        nest.ResetKernel()
        self.assertEqual(nest.CurrentSubnet(), (0, ))

        nest.BeginSubnet()
        self.assertEqual(nest.CurrentSubnet(), (1, ))