File: test_init.py

package info (click to toggle)
deap 1.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,372 kB
  • sloc: python: 9,874; ansic: 1,054; cpp: 592; javascript: 153; makefile: 95; sh: 7
file content (13 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
from functools import partial
import random
import unittest

from deap import tools


class LogbookTest(unittest.TestCase):
    def test_statistics_compile(self):
        l = 10
        gen_idx = partial(random.sample, list(range(l)), l)
        i = tools.initIterate(list, gen_idx)
        self.assertSetEqual(set(i), set(range(l)))