示例#1
0
 def test_get_commission_info_not_found(self):
     """Test function call of get_commission_info with invalid serial"""
     global token, auth_url
     try:
         client = AstakosClient(token['id'], auth_url)
         client.get_commission_info("57lala")
     except NotFound:
         pass
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     else:
         self.fail("Should have raised NotFound")
示例#2
0
 def test_get_commission_info_without_serial(self):
     """Test function call of get_commission_info without serial"""
     global token, auth_url
     try:
         client = AstakosClient(token['id'], auth_url)
         client.get_commission_info(None)
     except BadValue:
         pass
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     else:
         self.fail("Should have raise BadValue")
示例#3
0
文件: tests.py 项目: AthinaB/synnefo
 def test_get_commission_info_without_serial(self):
     """Test function call of get_commission_info without serial"""
     global token, auth_url
     try:
         client = AstakosClient(token['id'], auth_url)
         client.get_commission_info(None)
     except BadValue:
         pass
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     else:
         self.fail("Should have raise BadValue")
示例#4
0
文件: tests.py 项目: AthinaB/synnefo
 def test_get_commission_info_not_found(self):
     """Test function call of get_commission_info with invalid serial"""
     global token, auth_url
     try:
         client = AstakosClient(token['id'], auth_url)
         client.get_commission_info("57lala")
     except NotFound:
         pass
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     else:
         self.fail("Should have raised NotFound")
示例#5
0
 def test_get_commission_info_without_serial(self):
     """Test function call of get_commission_info without serial"""
     global token_1
     _mock_request([_request_ok])
     try:
         client = AstakosClient("https://example.com")
         client.get_commission_info(token_1, None)
     except BadValue:
         pass
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     else:
         self.fail("Should have raise BadValue")
示例#6
0
 def test_get_commission_info_not_found(self):
     """Test function call of get_commission_info with invalid serial"""
     global token_1
     _mock_request([_request_ok])
     try:
         client = AstakosClient("https://example.com")
         client.get_commission_info(token_1, "57lala")
     except NotFound:
         pass
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     else:
         self.fail("Should have raised NotFound")
示例#7
0
文件: tests.py 项目: AthinaB/synnefo
 def test_get_commission_info(self):
     """Test function call of get_commission_info"""
     global token, commission_description, auth_url
     try:
         client = AstakosClient(token['id'], auth_url,
                                use_pool=True, pool_size=2)
         response = client.get_commission_info(57)
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     self.assertEqual(response, commission_description)
示例#8
0
文件: tests.py 项目: vgerak/synnefo
 def test_get_commission_info(self):
     """Test function call of get_commission_info"""
     global token, commission_description, auth_url
     try:
         client = AstakosClient(token['id'], auth_url,
                                use_pool=True, pool_size=2)
         response = client.get_commission_info(57)
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     self.assertEqual(response, commission_description)
示例#9
0
 def test_get_commission_info(self):
     """Test function call of get_commission_info"""
     global token_1, commission_description
     _mock_request([_request_ok])
     try:
         client = \
             AstakosClient("https://example.com", use_pool=True, pool_size=2)
         response = client.get_commission_info(token_1, 57)
     except Exception as err:
         self.fail("Shouldn't raise Exception %s" % err)
     self.assertEqual(response, commission_description)