Fixing swagger test
Change-Id: Ibd2b07313bd7526ac574b98e8fbcc52eba0d6dd1
(cherry picked from commit 015ae9aed92b3a40fcf20e43fd5c9fd8b06ebd2b)
diff --git a/lib/xos-genx/tests/swagger_test.py b/lib/xos-genx/tests/swagger_test.py
index 4dde349..f87f47a 100644
--- a/lib/xos-genx/tests/swagger_test.py
+++ b/lib/xos-genx/tests/swagger_test.py
@@ -18,7 +18,7 @@
import yaml
from xosgenx.generator import XOSGenerator
-from helpers import FakeArgs
+from helpers import FakeArgs, OUTPUT_DIR
class Args:
pass
@@ -29,6 +29,7 @@
"""
[XOS-GenX] The swagger xtarget should generate the appropriate json
"""
+
# xosgenx --output . --target xosgenx/targets/swagger.xtarget --write-to-file single --dest-file swagger.yaml ../../xos/core/models/core.xproto
# http-server --cors Users/teone/Sites/opencord/orchestration/xos/lib/xos-genx/
xproto = \
@@ -58,12 +59,14 @@
args = FakeArgs()
args.inputs = xproto
args.target = 'swagger.xtarget'
- args.output = "/Users/teone/Sites/opencord/orchestration/xos/lib/xos-genx"
+ args.output = OUTPUT_DIR
args.write_to_file = "single"
args.dest_file = "swagger.yaml"
args.quiet = False
output = XOSGenerator.generate(args)
- self.assertEqual(True, False);
+ self.assertIn("/xosapi/v1/core/instances/:", output)
+ self.assertIn("/xosapi/v1/core/instances/{id}:", output)
+ self.assertIn("Instance:", output)
if __name__ == '__main__':
unittest.main()