Esempio n. 1
0
 def setUp(self):
     self.maxDiff = None
     self.afw_nonuniversality_check_test_1 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_nonuniversality_check_test_1.json')
     self.afw_nonuniversality_check_test_2 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_nonuniversality_check_test_2.json')
     self.afw_nonuniversality_check_test_empty = {
         'alphabet': set(),
         'states': set(),
         'initial_state': None,
         'accepting_states': set(),
         'transitions': {}
     }
Esempio n. 2
0
 def setUp(self):
     self.maxDiff = None
     self.afw_intersection_1_test_01 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_intersection_1_test_01.json')
     self.afw_intersection_2_test_01 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_intersection_2_test_01.json')
     self.afw_intersection_3_test_01 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_intersection_3_test_01.json')
     self.afw_intersection_test_empty = {
         'alphabet': set(),
         'states': set(),
         'initial_state': None,
         'accepting_states': set(),
         'transitions': {}
     }
 def test_afw_to_json(self):
     """ Tests a correct afw export to JSON file """
     name = 'JSON_afw_export'
     automata_IO.afw_to_json(self.afw_test_01, name, 'tests/outputs')
     re_imported_afw = automata_IO.afw_json_importer('tests/outputs/' +
                                                     name + '.json')
     self.assertDictEqual(self.afw_test_01, re_imported_afw)
Esempio n. 4
0
 def setUp(self):
     self.maxDiff = None
     self.nfa_afw_to_nfa_test_01 = automata_IO.nfa_dot_importer(
         './tests/dot/afw/nfa_afw_to_nfa_test_01.dot')
     self.afw_afw_to_nfa_test_01 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_afw_to_nfa_test_01.json')
     self.afw_nonemptiness_check_test_2 = automata_IO.afw_json_importer(
         './tests/json/afw/afw_nonemptiness_check_test_2.json')
     self.nfa_empty = {
         'alphabet': set(),
         'states': set(),
         'initial_states': set(),
         'accepting_states': set(),
         'transitions': {}
     }
     self.afw_afw_to_nfa_test_empty = {
         'alphabet': set(),
         'states': set(),
         'initial_state': None,
         'accepting_states': set(),
         'transitions': {}
     }
 def test_afw_json_importer(self):
     """ Tests importing a afw from a .json file """
     afw_01 = automata_IO.afw_json_importer(
         './tests/json/automata_io'
         '/automata_io_afw_json_importer_test_01.json')
     self.assertDictEqual(afw_01, self.afw_test_01)