def test_afw_intersection_disjoint(self):
""" Tests a correct afw intersection with completely disjoint afws """
AFW.rename_afw_states(self.afw_intersection_2_test_01, 'a_')
intersection = AFW.afw_intersection(self.afw_intersection_1_test_01,
self.afw_intersection_2_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_intersection_1_test_01, word)
original_acceptance_2 = AFW.afw_word_acceptance(
self.afw_intersection_2_test_01, word)
intersection_acceptance = AFW.afw_word_acceptance(intersection,
word)
self.assertEqual(
original_acceptance_1 and original_acceptance_2,
intersection_acceptance)
i += 1
评论列表
文章目录