Martin Betak has uploaded a new change for review.

Change subject: rpc: Add test for 'int' parameters in Bridge
......................................................................

rpc: Add test for 'int' parameters in Bridge

Change-Id: Ie8a2672c53411bed1ac711fffccb543bcfb16024
Signed-off-by: Martin Betak <mbe...@redhat.com>
---
M tests/bridgeTests.py
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/84/56884/1

diff --git a/tests/bridgeTests.py b/tests/bridgeTests.py
index b1f299c..d7058d4 100644
--- a/tests/bridgeTests.py
+++ b/tests/bridgeTests.py
@@ -55,6 +55,17 @@
         raise GeneralException("Kaboom!!!")
 
 
+class VM():
+    ctorArgs = ['vmID']
+
+    def __init__(self, UUID):
+        self._UUID = UUID
+
+    def migrationCreate(self, params, incomingLimit):
+        return {'status': {'code': 0, 'message': 'Done'},
+                'migrationPort': 0, 'params': {}}
+
+
 class StorageDomain():
     ctorArgs = ['storagedomainID']
 
@@ -75,6 +86,7 @@
     _API = __import__('API', globals(), locals(), {}, -1)
     setattr(_newAPI, 'Global', Host)
     setattr(_newAPI, 'StorageDomain', StorageDomain)
+    setattr(_newAPI, 'VM', VM)
 
     # Apply the whitelist to our version of API
     for name in apiWhitelist:
@@ -142,3 +154,12 @@
             bridge.dispatch('Host.ping')()
 
         self.assertEquals(e.exception.code, 100)
+
+    @MonkeyPatch(DynamicBridge, '_get_api_instance', _get_api_instance)
+    def testMethodWithIntParam(self):
+        bridge = DynamicBridge()
+
+        params = {"vmID": "773adfc7-10d4-4e60-b700-3272ee1871f9",
+                  "params": {"vmID": "773adfc7-10d4-4e60-b700-3272ee1871f9"},
+                  "incomingLimit": 42}
+        bridge.dispatch('VM.migrationCreate')(**params)


-- 
To view, visit https://gerrit.ovirt.org/56884
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8a2672c53411bed1ac711fffccb543bcfb16024
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbe...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to