Ejemplo n.º 1
0
 def get(self):
     testRunner = TestRunner(self.directory)
     self.write(testRunner.run())
Ejemplo n.º 2
0
ncolors, colours = File.read_file(
    'colours.txt')  # Total number of colours and list of colours

tr = TestRunner(colours)

# Requirement 1
tr.add_run_configuration(AlgorithmType.GREEDY_CONSTRUCTIVE, 100, 30)
tr.add_run_configuration(AlgorithmType.GREEDY_CONSTRUCTIVE, 500, 30)

# Requirement 2
tr.add_run_configuration(AlgorithmType.HILL_CLIMBING, 100, 30)
tr.add_run_configuration(AlgorithmType.HILL_CLIMBING, 500, 30)

# Requirement 3
# #   - 30 starts
# #   - Compute mean, median, STD
tr.add_run_configuration(AlgorithmType.MULTI_START_HC, 100, 30)
tr.add_run_configuration(AlgorithmType.MULTI_START_HC, 500, 30)
#
# # Requirement 4
# #   - 30 starts
# #   - Compute mean, median, STD
# IMPORTANT: Time required for DELTA SORT: ~16 minutes. #
tr.add_run_configuration(AlgorithmType.DELTA_SORT, 100, 30)
tr.add_run_configuration(AlgorithmType.DELTA_SORT, 500, 30)

tr.configure()
tr.run()
tr.plot_all()
Ejemplo n.º 3
0
import os
from TestRunner import TestRunner
import unittest


class MyTestCase(unittest.TestCase):
    def test_A(self):
        """A simple test that should PASS."""
        self.assertTrue(True)

    def test_B(self):
        """A simple test FAILURE."""
        self.assertFalse(True)

    @staticmethod
    def test_C():
        """A simple ERROR raising test."""
        assert 1 + 'a' == 32


if __name__ == '__main__':
    test_suite = unittest.TestLoader().loadTestsFromTestCase(MyTestCase)
    fp = os.path.join(os.path.dirname(__file__), "test.html")
    runner = TestRunner(stream=fp,
                        title="My test report sample",
                        description="This is a sample test case.")
    runner.run(test_suite)