summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-03-27 07:30:09 -0700
committerEthan Lynn <ethanlynnl@vmware.com>2018-03-27 07:30:55 -0700
commitb843c0542c11d3631044ad3aedf9a93e1dfffa07 (patch)
treee4b154b3871d66b86bf90aa1b5676a9652d7d559 /vio
parentca65c6358c3900ff6b3ed944b33198ebe0d545b1 (diff)
Add test_combine_url
Add test_combine_url for restcall.py Change-Id: I33bf57e2d7daa46407fc67660bbfccc7e252e4d9 Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_restcall.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/vio/vio/tests/test_restcall.py b/vio/vio/tests/test_restcall.py
new file mode 100644
index 0000000..5baf83e
--- /dev/null
+++ b/vio/vio/tests/test_restcall.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2017-2018 VMware, Inc.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+import unittest
+
+from vio.pub.utils import restcall
+
+
+class TestRestCall(unittest.TestCase):
+
+ def test_combine_url(self):
+ url = ["http://a.com/test/", "http://a.com/test/",
+ "http://a.com/test", "http://a.com/test"]
+ res = ["/resource", "resource", "/resource", "resource"]
+ expected = "http://a.com/test/resource"
+ for i in range(len(url)):
+ self.assertEqual(expected, restcall.combine_url(url[i], res[i]))