def test_create_manifest_json_with_default_name(self):
     default_name = "manifest.json"
     app_type = "TEST_TYPE"
     manifest_dict = {
         "type": app_type
     }
     self.mock_file_utils.save_text_file.return_value = MANIFEST_PATH
     manifest_json = ServiceOffering.create_manifest_json(app_type=app_type)
     assert manifest_json == MANIFEST_PATH
     self.mock_file_utils.save_text_file.assert_called_with(data=json.dumps(manifest_dict), file_name=default_name)
Esempio n. 2
0
def sample_service(class_context, sample_app_jar):
    log_fixture("Prepare mainfest and offering json")
    offering_json = ServiceOffering.create_offering_json()
    manifest_json = ServiceOffering.create_manifest_json(app_type=TapApplicationType.JAVA)
    log_fixture("Create new example service from binary")
    sample_service = ServiceOffering.create_from_binary(class_context, jar_path=sample_app_jar,
                                                        manifest_path=manifest_json, offering_path=offering_json)
    log_fixture("Check the service is ready")
    sample_service.ensure_ready()
    return sample_service
Esempio n. 3
0
 def manifest_json(self):
     return ServiceOffering.create_manifest_json(self.APP_TYPE)