Beispiel #1
0
    def test_all_states_exported(self):
        from sismic.io.text import export_to_tree

        for f in self.files:
            statechart = io.import_from_yaml(f)
            result = sorted(export_to_tree(statechart, spaces=0))
            expected = sorted(self.states(statechart))

            self.assertEquals(expected, result)
Beispiel #2
0
    def test_correct_spaces(self):
        from sismic.io.text import export_to_tree

        for f in self.files:
            statechart = io.import_from_yaml(f)
            result = sorted(export_to_tree(statechart, spaces=1))

            for r in result:
                name = r.lstrip()
                depth = statechart.depth_for(name)
                spaces = len(r) - len(name)
                self.assertEquals(depth-1, spaces)
Beispiel #3
0
    def test_export(self):
        from sismic.io.text import export_to_tree

        for f, r in zip(self.files, self.results):
            statechart = io.import_from_yaml(f)
            self.assertEquals(export_to_tree(statechart), r)