Did I find the right examples for you? yes no

All Samples(14)  |  Call(12)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_util/test_misc.py   cogent(Download)
from cogent.app.util import get_tmp_filename
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import (iterable, max_index, min_index,
    flatten, is_iterable, is_char, is_char_or_noniterable,
    is_str_or_noniterable, not_list_tuple, list_flatten,
                            "BBB", "BBA", "BAB", "BAA"]
 
        real_result = generateCombinations("AB", 3)
 
        correct_result.sort()
    def test_generateCombinations_singleAlphabet(self):
        """function should return correct value when alphabet is one char"""
 
        real_result = generateCombinations("A", 4)
        self.assertEquals(str(real_result), str(["AAAA"]))
    def test_generateCombinations_singleLength(self):
        """function should return correct values if length is 1"""
 
        real_result = generateCombinations("ABC", 1)
        self.assertEquals(str(real_result), str(["A", "B", "C"]))
    def test_generateCombinations_emptyAlphabet(self):
        """function should return empty list if alphabet arg is [], "" """
 
        real_result = generateCombinations("", 4)
        self.assertEquals(str(real_result), str([]))

src/p/y/pycogent-HEAD/tests/test_util/test_misc.py   pycogent(Download)
from cogent.app.util import get_tmp_filename
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import (iterable, max_index, min_index,
    flatten, is_iterable, is_char, is_char_or_noniterable,
    is_str_or_noniterable, not_list_tuple, list_flatten,
                            "BBB", "BBA", "BAB", "BAA"]
 
        real_result = generateCombinations("AB", 3)
 
        correct_result.sort()
    def test_generateCombinations_singleAlphabet(self):
        """function should return correct value when alphabet is one char"""
 
        real_result = generateCombinations("A", 4)
        self.assertEquals(str(real_result), str(["AAAA"]))
    def test_generateCombinations_singleLength(self):
        """function should return correct values if length is 1"""
 
        real_result = generateCombinations("ABC", 1)
        self.assertEquals(str(real_result), str(["A", "B", "C"]))
    def test_generateCombinations_emptyAlphabet(self):
        """function should return empty list if alphabet arg is [], "" """
 
        real_result = generateCombinations("", 4)
        self.assertEquals(str(real_result), str([]))