Exemplo n.º 1
0
 def test_examples(self):
     files = ['elevator', 'elevator_contract', 'microwave', 'tester_elevator_7th_floor_never_reached',
              'tester_elevator_moves_after_10s', 'writer_options']
     for f in files:
         d = io.export_to_yaml(io.import_from_yaml(open(os.path.join('docs', 'examples', f+'.yaml'))))
         # check
         io.import_from_yaml(d)
Exemplo n.º 2
0
 def test_yaml_tests(self):
     files = ['actions', 'composite', 'deep_history', 'infinite', 'internal', 'nested_parallel',
              'nondeterministic', 'parallel', 'simple', 'timer']
     for f in files:
         d = io.export_to_yaml(io.import_from_yaml(open(os.path.join('tests', 'yaml', f+'.yaml'))))
         # check
         io.import_from_yaml(d)
Exemplo n.º 3
0
    def test_export_valid(self):
        for f, filename in self.files:
            with self.subTest(filename=filename):
                sc_1 = io.import_from_yaml(f)
                ex_1 = io.export_to_yaml(sc_1)
                sc_2 = io.import_from_yaml(ex_1)

                self.assertTrue(sc_2.validate())
Exemplo n.º 4
0
    def test_export_valid(self):
        for f, filename in self.files:
            with self.subTest(filename=filename):
                sc_1 = io.import_from_yaml(f)
                ex_1 = io.export_to_yaml(sc_1)
                sc_2 = io.import_from_yaml(ex_1)

                self.assertTrue(sc_2.validate())
Exemplo n.º 5
0
 def test_export(self):
     for f, filename in self.files:
         with self.subTest(filename=filename):
             sc_1 = io.import_from_yaml(f)
             io.export_to_yaml(sc_1)
Exemplo n.º 6
0
 def test_export(self):
     for f, filename in self.files:
         with self.subTest(filename=filename):
             sc_1 = io.import_from_yaml(f)
             io.export_to_yaml(sc_1)
Exemplo n.º 7
0
 def test_identity_for_example_from_docs(self, example_from_docs):
     compare_statecharts(
         example_from_docs,
         import_from_yaml(export_to_yaml(example_from_docs)))
Exemplo n.º 8
0
 def test_validity_for_example_from_docs(self, example_from_docs):
     assert import_from_yaml(export_to_yaml(example_from_docs)).validate()
Exemplo n.º 9
0
 def test_export_example_from_docs(self, example_from_docs):
     assert len(export_to_yaml(example_from_docs)) > 0