import unittest from utils import run_file, get_constructor, get_model_constructor all_files = [ "core/mini_modify.alc", "core/core_formalism.mvc", "core/core_algorithm.alc", "primitives.alc", "object_operations.alc", "conformance_scd.alc", "library.alc", "ftg.alc", "transform.alc", "model_management.alc", "ramify.alc", "metamodels.alc", "random.alc", "constructors.alc", "modelling.alc", "compilation_manager.alc", ] class TestModelverseCore(unittest.TestCase): def test_po_list(self): self.list("PO") def list(self, mode): self.assertTrue(run_file(all_files, [ "root", "model_list", ], [ "Desired username for admin user?", "Welcome to the Model Management Interface v2.0!", "Use the 'help' command for a list of possible commands", "Ready for command...", set([" SimpleClassDiagrams : SimpleClassDiagrams", " CoreFormalism : SimpleClassDiagrams", " core : CoreFormalism"]), ], mode)) def test_po_list_full(self): self.list_full("PO") def list_full(self, mode): self.assertTrue(run_file(all_files, [ "root", "model_list_full", ], [ "Desired username for admin user?", "Welcome to the Model Management Interface v2.0!", "Use the 'help' command for a list of possible commands", "Ready for command...", set([" 221 root admin 673 SimpleClassDiagrams : SimpleClassDiagrams", " 221 root admin 86 CoreFormalism : SimpleClassDiagrams", " 200 root admin 43 core : CoreFormalism"]), ], mode)) def test_po_model_add_empty(self): self.model_add_empty("PO") def model_add_empty(self, mode): self.assertTrue(run_file(all_files, [ "root", "model_add", "SimpleClassDiagrams", "Empty", "exit", "model_list", "model_list_full", ], [ "Desired username for admin user?", "Welcome to the Model Management Interface v2.0!", "Use the 'help' command for a list of possible commands", "Ready for command...", "Creating new model!", "Model type?", "Model name?", "Waiting for model constructors...", "Model upload success!", "Ready for command...", set([" SimpleClassDiagrams : SimpleClassDiagrams", " CoreFormalism : SimpleClassDiagrams", " Empty : SimpleClassDiagrams", " core : CoreFormalism"]), "Ready for command...", set([" 221 root admin 673 SimpleClassDiagrams : SimpleClassDiagrams", " 221 root admin 86 CoreFormalism : SimpleClassDiagrams", " 200 root nobody 0 Empty : SimpleClassDiagrams", " 200 root admin 53 core : CoreFormalism"]), ], mode))