コード例 #1
0
    def test_stack_checker(self):
        def empty_stack():
            nest.sli_run('clear')

        def leave_on_stack():
            nest.sli_push(1)

        check_empty_stack = nest.stack_checker(empty_stack)
        check_leave_on_stack = nest.stack_checker(leave_on_stack)

        debug = nest.get_debug()
        # We have to set debug to True to check the stack
        nest.set_debug(True)

        # This should pass without errors
        check_empty_stack()

        try:
            self.assertRaises(nest.NESTError, check_leave_on_stack)
        except:  # Ensure that debug is reset if we get an error.
            nest.set_debug(debug)
            raise
        nest.set_debug(debug)
コード例 #2
0
    def test_stack_checker(self):
        def empty_stack():
            nest.sli_run('clear')

        def leave_on_stack():
            nest.sli_push(1)

        check_empty_stack = nest.stack_checker(empty_stack)
        check_leave_on_stack = nest.stack_checker(leave_on_stack)

        debug = nest.get_debug()
        # We have to set debug to True to check the stack
        nest.set_debug(True)

        # This should pass without errors
        check_empty_stack()

        try:
            self.assertRaises(nest.NESTError, check_leave_on_stack)
        except:  # Ensure that debug is reset if we get an error.
            nest.set_debug(debug)
            raise
        nest.set_debug(debug)
コード例 #3
0
ファイル: test_all.py プロジェクト: worminbrain1/NEUCOGAR
    suite.addTest(test_connect_all_to_all.suite())
    suite.addTest(test_connect_fixed_indegree.suite())
    suite.addTest(test_connect_fixed_outdegree.suite())
    suite.addTest(test_connect_fixed_total_number.suite())
    suite.addTest(test_connect_one_to_one.suite())
    suite.addTest(test_connect_pairwise_bernoulli.suite())
    suite.addTest(test_findconnections.suite())    
    suite.addTest(test_getconnections.suite())
    suite.addTest(test_dataconnect.suite())
    suite.addTest(test_events.suite())
    suite.addTest(test_networks.suite())
    suite.addTest(test_threads.suite())    
    suite.addTest(test_csa.suite())
    suite.addTest(test_quantal_stp_synapse.suite())
    suite.addTest(test_sp.suite())
    suite.addTest(test_parrot_neuron.suite())
    suite.addTest(test_stdp_triplet_synapse.suite())    

    return suite


if __name__ == "__main__":

    debug = nest.get_debug()
    nest.set_debug(True)

    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite())

    nest.set_debug(debug)
コード例 #4
0
ファイル: test_all.py プロジェクト: hendrikrth/nest-simulator
    suite.addTest(test_connect_one_to_one.suite())
    suite.addTest(test_connect_pairwise_bernoulli.suite())
    suite.addTest(test_connect_array_fixed_indegree.suite())
    suite.addTest(test_connect_array_fixed_outdegree.suite())
    suite.addTest(test_getconnections.suite())
    suite.addTest(test_dataconnect.suite())
    suite.addTest(test_events.suite())
    suite.addTest(test_networks.suite())
    suite.addTest(test_threads.suite())
    suite.addTest(test_csa.suite())
    suite.addTest(test_quantal_stp_synapse.suite())
    suite.addTest(test_sp.suite())
    suite.addTest(test_parrot_neuron.suite())
    suite.addTest(test_stdp_triplet_synapse.suite())
    suite.addTest(test_weight_recorder.suite())
    suite.addTest(test_aeif_lsodar.suite())
    suite.addTest(test_use_gid_in_filename.suite())

    return suite


if __name__ == "__main__":

    debug = nest.get_debug()
    nest.set_debug(True)

    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite())

    nest.set_debug(debug)