summaryrefslogtreecommitdiffstats
path: root/tests/test_partitioner.py
diff options
context:
space:
mode:
authorUlas Kozat <ulas.kozat@gmail.com>2016-11-18 20:25:43 -0800
committerUlas Kozat <ulas.kozat@gmail.com>2016-11-18 20:25:43 -0800
commit96af8475e3db496be22d2ede78081c1c67a51f96 (patch)
treec5207f6fffef26d9c0793f494ecf6edee6720908 /tests/test_partitioner.py
parent6aa5772f98296bf9bbb9bbed144cf52d48949119 (diff)
JIRA Issue DOMINO-20
Change-Id: I86a2b72d36c5807f384d39bd72305b9b4b36835c Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
Diffstat (limited to 'tests/test_partitioner.py')
-rwxr-xr-xtests/test_partitioner.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/test_partitioner.py b/tests/test_partitioner.py
index 246f6ba..75ec817 100755
--- a/tests/test_partitioner.py
+++ b/tests/test_partitioner.py
@@ -11,20 +11,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import sys, os, glob
+import sys, os, glob, yaml
sys.path.insert(0, glob.glob('./lib')[0])
-from toscaparser.tosca_template import ToscaTemplate
+#from toscaparser.tosca_template import ToscaTemplate
from mapper import *
from partitioner import *
def main(argv):
try:
- tosca = ToscaTemplate(argv[0])
+ #tosca = ToscaTemplate(argv[0])
+ tpl = yaml.load(file(argv[0],'r'))
# Extract Labels
- node_labels = label.extract_labels( tosca )
+ node_labels = label.extract_labels( tpl )
print node_labels
site_id = 0
subscribed_labels = {}
@@ -40,10 +41,11 @@ def main(argv):
node_site = label.select_site( site_map )
print node_site
- file_paths = partitioner.partition_tosca("./tests/tmp/tosca",node_site,tosca.tpl)
+ file_paths = partitioner.partition_tosca("./tests/tmp/tosca",node_site,tpl)
print file_paths
except:
print('Unexpected error: %s', sys.exc_info()[0])
if __name__ == "__main__":
main(sys.argv[1:])
+