Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
5e833577
Commit
5e833577
authored
Mar 03, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added get_input_tosca_file_path and run test
parent
c24f404d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
test_planner.py
planner/test/test_planner.py
+31
-4
No files found.
planner/test/test_planner.py
View file @
5e833577
...
...
@@ -14,21 +14,48 @@ from planner.planner import Planner
from
service.spec_service
import
SpecService
from
util
import
tosca_helper
logger
=
logging
.
getLogger
(
__name__
)
class
MyTestCase
(
unittest
.
TestCase
):
def
test_planner
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
def
test_only_docker_node
(
self
):
file_name
=
'application_example_updated.yaml'
input_tosca_file_path
=
self
.
get_input_tosca_file_path
(
file_name
)
self
.
run_test
(
input_tosca_file_path
)
# def test_planner(self):
# conf = {'url': "http://host"}
# spec_service = SpecService(conf)
# test_planner = Planner(input_tosca_file_path, spec_service)
# test_tosca_template = test_planner.resolve_requirements()
# test_tosca_template = test_planner.set_infrastructure_specifications()
# template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template)
# logger.info("template ----: \n" + yaml.dump(template_dict))
#
# ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
#
# test_response = {'toscaTemplate': template_dict}
#
# response = {'toscaTemplate': template_dict}
# output_current_milli_time = int(round(time.time() * 1000))
# response["creationDate"] = output_current_milli_time
# response["parameters"] = []
# print("Output message:" + json.dumps(response))
# self.assertEqual(True, True)
def
get_input_tosca_file_path
(
self
,
file_name
):
tosca_path
=
"../../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/application_example_updated.yaml'
input_tosca_file_path
=
tosca_path
+
file_name
if
not
os
.
path
.
exists
(
input_tosca_file_path
):
tosca_path
=
"../TOSCA/"
input_tosca_file_path
=
tosca_path
+
'/application_example_updated.yaml'
input_tosca_file_path
=
tosca_path
+
file_name
self
.
assertEqual
(
True
,
os
.
path
.
exists
(
input_tosca_file_path
),
"Input TOSCA file: "
+
input_tosca_file_path
+
" not found"
)
return
input_tosca_file_path
def
run_test
(
self
,
input_tosca_file_path
):
conf
=
{
'url'
:
"http://host"
}
spec_service
=
SpecService
(
conf
)
test_planner
=
Planner
(
input_tosca_file_path
,
spec_service
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment