def test_afw_union_empty_states_1(self):
""" Tests a afw union where the first afw is empty """
union = AFW.afw_union(self.afw_union_test_empty,
self.afw_union_1_test_01)
i = 0
last = 7
while i <= last:
base = list(itertools.repeat('a', i))
base += list(itertools.repeat('b', i))
# build all permutation of 'a' and 'b' till length i
word_set = set(itertools.permutations(base, i))
for word in word_set:
word = list(word)
original_acceptance_1 = AFW.afw_word_acceptance(
self.afw_union_1_test_01, word)
original_acceptance_2 = AFW.afw_word_acceptance(
self.afw_union_test_empty, word)
union_acceptance = AFW.afw_word_acceptance(union, word)
self.assertEqual(
original_acceptance_1 or original_acceptance_2,
union_acceptance)
i += 1
评论列表
文章目录