test_mvc.py 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import unittest
  2. from utils import run_file, get_constructor, get_model_constructor
  3. all_files = [ "core/mini_modify.alc",
  4. "core/core_formalism.mvc",
  5. "core/core_algorithm.alc",
  6. "primitives.alc",
  7. "object_operations.alc",
  8. "conformance_scd.alc",
  9. "library.alc",
  10. "ftg.alc",
  11. "transform.alc",
  12. "model_management.alc",
  13. "ramify.alc",
  14. "metamodels.alc",
  15. "random.alc",
  16. "constructors.alc",
  17. "modelling.alc",
  18. "compilation_manager.alc",
  19. ]
  20. class TestModelverseCore(unittest.TestCase):
  21. def test_po_list(self):
  22. self.list("PO")
  23. def list(self, mode):
  24. self.assertTrue(run_file(all_files,
  25. [ "root",
  26. "model_list",
  27. ],
  28. [ "Desired username for admin user?",
  29. "Welcome to the Model Management Interface v2.0!",
  30. "Use the 'help' command for a list of possible commands",
  31. "Ready for command...",
  32. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  33. " CoreFormalism : SimpleClassDiagrams",
  34. " core : CoreFormalism"]),
  35. ],
  36. mode))
  37. def test_po_list_full(self):
  38. self.list_full("PO")
  39. def list_full(self, mode):
  40. self.assertTrue(run_file(all_files,
  41. [ "root",
  42. "model_list_full",
  43. ],
  44. [ "Desired username for admin user?",
  45. "Welcome to the Model Management Interface v2.0!",
  46. "Use the 'help' command for a list of possible commands",
  47. "Ready for command...",
  48. set([" 221 root admin 673 SimpleClassDiagrams : SimpleClassDiagrams",
  49. " 221 root admin 86 CoreFormalism : SimpleClassDiagrams",
  50. " 200 root admin 43 core : CoreFormalism"]),
  51. ],
  52. mode))
  53. def test_po_model_add_empty(self):
  54. self.model_add_empty("PO")
  55. def model_add_empty(self, mode):
  56. self.assertTrue(run_file(all_files,
  57. [ "root",
  58. "model_add",
  59. "SimpleClassDiagrams",
  60. "Empty",
  61. "exit",
  62. "model_list",
  63. "model_list_full",
  64. ],
  65. [ "Desired username for admin user?",
  66. "Welcome to the Model Management Interface v2.0!",
  67. "Use the 'help' command for a list of possible commands",
  68. "Ready for command...",
  69. "Creating new model!",
  70. "Model type?",
  71. "Model name?",
  72. "Waiting for model constructors...",
  73. "Model upload success!",
  74. "Ready for command...",
  75. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  76. " CoreFormalism : SimpleClassDiagrams",
  77. " Empty : SimpleClassDiagrams",
  78. " core : CoreFormalism"]),
  79. "Ready for command...",
  80. set([" 221 root admin 673 SimpleClassDiagrams : SimpleClassDiagrams",
  81. " 221 root admin 86 CoreFormalism : SimpleClassDiagrams",
  82. " 200 root nobody 0 Empty : SimpleClassDiagrams",
  83. " 200 root admin 53 core : CoreFormalism"]),
  84. ],
  85. mode))