def test_06(self):
     # Arrange
     data = ['@startuml\\n', '  allMyBlocks\\n', '  getBlock()\\n', '}\\n']
     validate = ValidateData(data)
     expected_result = False
     # Act
     actual_result = validate.check_class_count()
     # Assert
     self.assertEqual(actual_result, expected_result,
                      'Expected to be False')
 def test_10(self):
     # Arrange
     data = [
         'class LevelEditor{\\n', '  allMyBlocks\\n', '  getBlock()\\n',
         '}\\n', '@enduml'
     ]
     validate = ValidateData(data)
     expected_result = False
     # Act
     actual_result = validate.is_validate_date()
     # Assert
     self.assertEqual(actual_result, expected_result, 'Expected to be True')
 def test_01(self):
     # Arrange
     data = [
         '@startuml\\n', 'class LevelEditor{\\n', '  allMyBlocks\\n',
         '  getBlock()\\n', '}\\n', '@enduml'
     ]
     validate = ValidateData(data)
     expected_result = True
     # Act
     actual_result = validate.check_start_uml()
     # Assert
     self.assertEqual(actual_result, expected_result, 'Expected to be True')
 def test_05(self):
     # Arrange
     data = [
         '@startuml\\n', 'class LevelEditor{\\n', '  allMyBlocks\\n',
         '  getBlock()\\n', '}\\n', 'class GamePlayer{\\n', 'myPosition',
         '}\\n', '@enduml'
     ]
     validate = ValidateData(data)
     expected_result = True
     # Act
     actual_result = validate.check_class_count()
     # Assert
     self.assertEqual(actual_result, expected_result,
                      'Expected to be False')
Example #5
0
def start():
    print('start')
    file_handler = FileHandler()
    file_content = file_handler.load_from_file()
    validate = ValidateData(file_content)
    if validate.is_validate_date():
        interpreter = UmlInterpreter()
        uml_list = interpreter.uml_decoder(file_content)

        # builder = PythonBuilder()
        builder = JavaScriptBuilder()
        director = CodeDirector(builder)
        director.construct(uml_list)
        all_my_classes = builder.get_classes()

        file_handler.get_folder_dir()
        for item in all_my_classes:
            # file_name = root.directory + '/' + item['file_name']
            file_handler.write_to_file(item['file_name'], item['file_content'])
            file_handler.write_to_pickle(item['file_name'],
                                         item['file_content'])
    print('end')
 def pass_validate_data(output):
     return ValidateData.validate_test_loader(output)