Example #1
0
class IBMTests(unittest.TestCase, TestCaseMixin):
    """
    Tests the IBM Developer Cloud driver.
    """

    def setUp(self):
        IBM.connectionCls.conn_classes = (None, IBMMockHttp)
        IBMMockHttp.type = None
        self.driver = IBM(IBM_USER, IBM_SECRET)

    def test_auth(self):
        IBMMockHttp.type = 'UNAUTHORIZED'

        try:
            self.driver.list_nodes()
        except InvalidCredsError, e:
            self.assertTrue(isinstance(e, InvalidCredsError))
            self.assertEquals(e.value, '401: Unauthorized')
        else:
Example #2
0
 def setUp(self):
     IBM.connectionCls.conn_classes = (None, IBMMockHttp)
     IBMMockHttp.type = None
     self.driver = IBM(IBM_USER, IBM_SECRET)