def test_get_chromosome():
    test_case_factory = MagicMock(tcf.TestCaseFactory)
    factory = cf.TestSuiteChromosomeFactory(test_case_factory)
    config.INSTANCE.min_initial_tests = 5
    config.INSTANCE.max_initial_tests = 5
    chromosome = factory.get_chromosome()
    assert (config.INSTANCE.min_initial_tests <=
            test_case_factory.get_test_case.call_count <=
            config.INSTANCE.max_initial_tests)
    assert isinstance(chromosome, tsc.TestSuiteChromosome)
 def __init__(self, executor: TestCaseExecutor,
              test_cluster: TestCluster) -> None:
     super().__init__(executor, test_cluster)
     self._chromosome_factory = cf.TestSuiteChromosomeFactory(
         tcf.RandomLengthTestCaseFactory(self._test_factory))
     self._population: List[tsc.TestSuiteChromosome] = []
     self._selection_function: SelectionFunction[
         tsc.TestSuiteChromosome] = RankSelection()
     self._crossover_function: CrossOverFunction[
         tsc.TestSuiteChromosome] = SinglePointRelativeCrossOver()
     self._fitness_functions = self.get_fitness_functions()