<commit_before>"""
Unit test for TopoConsole
$Id$
"""
__version__='$Revision$'


# CEBHACKALERT: doesn't test topoconsole completely.

import topo
import unittest
from topo.tkgui import *
from topo.base.simulation import Simulation
import topo.base.parameterizedobject
import topo.base.simulation

class TestTopoConsole(unittest.TestCase):
    def setUp(self):
        # CEBHACKALERT: do we need such a test now?
        # topo.base.registry.set_active_sim(None)
        self.s = Simulation(register=False)
        self.console = start()
        topo.base.parameterizedobject.min_print_level = topo.base.parameterizedobject.WARNING
        self.s.print_level = topo.base.parameterizedobject.WARNING

    def test_do_learning(self):
        run_time = 15.5
        topo.sim.change_sim(self.s)
        start_time = self.s.time()
        self.console.do_learning(str(run_time))
        end_time = self.s.time()
        self.assertEqual(start_time+run_time,end_time)

    def tearDown(self):
        self.console.quit()


suite = unittest.TestSuite()
#  Uncomment the following line of code, to disable the test if
#  $DISPLAY is undefined.  Used mainly for GUI testing.
suite.requires_display = True
suite.addTest(unittest.makeSuite(TestTopoConsole))

if __name__ == '__main__':
    unittest.TextTestRunner(verbosity=2).run(suite)
<commit_msg>Removed test that didn't have much use.<commit_after>"""
Unit test for TopoConsole
$Id$
"""
__version__='$Revision$'


# CEBHACKALERT: doesn't test topoconsole completely.

import topo
import unittest
from topo.tkgui import *
from topo.base.simulation import Simulation
import topo.base.parameterizedobject
import topo.base.simulation

class TestTopoConsole(unittest.TestCase):
    def setUp(self):
        # CEBHACKALERT: do we need such a test now?
        # topo.base.registry.set_active_sim(None)
        self.s = Simulation(register=False)
        self.console = start()
        topo.base.parameterizedobject.min_print_level = topo.base.parameterizedobject.WARNING
        self.s.print_level = topo.base.parameterizedobject.WARNING

    def tearDown(self):
        self.console.quit()


suite = unittest.TestSuite()
#  Uncomment the following line of code, to disable the test if
#  $DISPLAY is undefined.  Used mainly for GUI testing.
suite.requires_display = True
suite.addTest(unittest.makeSuite(TestTopoConsole))

if __name__ == '__main__':
    unittest.TextTestRunner(verbosity=2).run(suite)

{'fraction_non_alphanumeric': 0.09787059787059788, 'fraction_numerical': 0.0020475020475020475, 'mean_word_length': 3.886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2336823', 'n_tokens_mistral': 798, 'n_tokens_neox': 773, 'n_words': 175}