소스 검색

Updated test for model_render

Yentl Van Tendeloo 8 년 전
부모
커밋
be4f78aab7
1개의 변경된 파일10개의 추가작업 그리고 133개의 파일을 삭제
  1. 10 133
      integration/test_mvc.py

+ 10 - 133
integration/test_mvc.py

@@ -520,136 +520,13 @@ class TestModelverseCore(unittest.TestCase):
             ]))
 
     def test_render(self):
-        self.assertTrue(run_file(all_files,
-            [ "admin", "admin", "admin", 
-                "model_add",
-                    "SimpleClassDiagrams",
-                    "CausalBlockDiagrams",
-                    ] + get_model_constructor(open("integration/code/cbd_design.mvc", "r").read()) + [
-                "model_add",
-                    "SimpleClassDiagrams",
-                    "MM_rendered_graphical",
-                    ] + get_model_constructor(open("models/MM_rendered_graphical.mvc", "r").read()) + [
-                "model_add",
-                    "CausalBlockDiagrams",
-                    "my_CBD",
-                    ] + get_model_constructor(open("integration/code/my_cbd.mvc", "r").read()) + [
-                "model_list",
-                "transformation_add_MT_language",
-                "CausalBlockDiagrams",
-                "MM_rendered_graphical",
-                "",
-                "CBD_RAM",
-                "model_modify",
-                    "__merged_CBD_RAM",
-                        "instantiate",
-                            "Association",
-                            "TracabilityLink",
-                            "CausalBlockDiagrams/Block",
-                            "MM_rendered_graphical/Group",
-                        "exit",
-                "transformation_RAMify",
-                    "__merged_CBD_RAM",
-                    "CBD_RAM",
-                "transformation_add_MT",
-                    "CBD_RAM",
-                    "CausalBlockDiagrams",
-                    "MM_rendered_graphical",
-                    "",
-                    "MM_rendered_graphical",
-                    "",
-                    "render_graphical_CBD",
-                    ] + get_model_constructor(open("models/CBD_mapper.mvc", "r").read()) + [
-                "model_list",
-                "model_render",
-                    "my_CBD",
-                    "render_graphical_CBD",
-            ],
-            [   # bootup phase
-                "Desired username for admin user?",
-                "Desired password for admin user?",
-                "Please repeat the password",
-                "Passwords match!",
-                "Welcome to the Model Management Interface v2.0!",
-                "Use the 'help' command for a list of possible commands",
-                "Ready for command...",
-                # model_add
-                "Creating new model!",
-                "Model type?",
-                "Model name?",
-                "Waiting for model constructors...",
-                "Model upload success!",
-                "Ready for command...",
-                # model_add
-                "Creating new model!",
-                "Model type?",
-                "Model name?",
-                "Waiting for model constructors...",
-                "Model upload success!",
-                "Ready for command...",
-                # model_add
-                "Creating new model!",
-                "Model type?",
-                "Model name?",
-                "Waiting for model constructors...",
-                "Model upload success!",
-                "Ready for command...",
-                # model_list
-                set(model_list) |
-                set([
-                    "  CausalBlockDiagrams : SimpleClassDiagrams",
-                    "  MM_rendered_graphical : SimpleClassDiagrams",
-                    "  my_CBD : CausalBlockDiagrams",
-                    ]),
-                "Ready for command...",
-                # transformation_add_MT_language
-                "Formalisms to include (terminate with empty string)?",
-                "Name of the RAMified transformation metamodel?",
-                "Ready for command...",
-                # model_modify
-                "Which model do you want to modify?",
-                "Model loaded, ready for commands!",
-                "Mode: r/w",
-                "Use 'help' command for a list of possible commands",
-                "Please give your command.",
-                    # instantiate
-                    "Type to instantiate?",
-                    "Name of new element?",
-                    "Source name?",
-                    "Destination name?",
-                    "Instantiation successful!",
-                    None,
-                    "Please give your command.",
-                "Ready for command...",
-                # transformation_RAMify
-                "Which metamodel do you want to RAMify?",
-                "Where do you want to store the RAMified metamodel?",
-                "Ready for command...",
-                # transformation_add_MT
-                "RAMified metamodel to use?",
-                "Supported metamodels:",
-                set(["  CausalBlockDiagrams",
-                     "  MM_rendered_graphical",
-                    ]),
-                "Which metamodels do you want to use as source for the operation (empty string to finish)?",
-                "Which metamodels do you want to use as target for the operation (empty string to finish)?",
-                "Name of new operation?",
-                "Waiting for model constructors...",
-                "Ready for command...",
-                # model_list
-                set(model_list) |
-                set([
-                    "  CausalBlockDiagrams : SimpleClassDiagrams",
-                    "  MM_rendered_graphical : SimpleClassDiagrams",
-                    "  CBD_RAM : SimpleClassDiagrams",
-                    "  my_CBD : CausalBlockDiagrams",
-                    "  render_graphical_CBD : CBD_RAM",
-                    "  __merged_CBD_RAM : SimpleClassDiagrams",
-                     ]),
-                "Ready for command...",
-                # model_render
-                "Model to render?",
-                "Mapper to use?",
-                "Mapping success",
-                None,
-            ]))
+        model_add("CausalBlockDiagrams", "SimpleClassDiagrams", open("integration/code/cbd_design.mvc", 'r').read())
+        model_add("MM_rendered_graphical", "SimpleClassDiagrams", open("models/MM_rendered_graphical.mvc", 'r').read())
+        model_add("my_CBD", "CausalBlockDiagrams", open("integration/code/my_cbd.mvc", 'r').read())
+
+        transformation_add_MT_language(["CausalBlockDiagrams", "MM_rendered_graphical"], "CBD_RAM")
+        instantiate("__merged_CBD_RAM", "Association", ("CausalBlockDiagrams/Block", "MM_rendered_graphical/Group"), ID="TracabilityLink")
+        transformation_RAMify("__merged_CBD_RAM", "CBD_RAM")
+
+        transformation_add_MT("CBD_RAM", ["CausalBlockDiagrams", "MM_rendered_graphical"], ["MM_rendered_graphical"], "render_graphical_CBD", open("models/CBD_mapper.mvc", 'r').read())
+        model_render("my_CBD", "render_graphical_CBD")