class VoxelTest(unittest.TestCase): def setUp(self): Voxel.connectionCls.conn_classes = (None, VoxelMockHttp) VoxelMockHttp.type = None self.driver = Voxel(VOXEL_KEY, VOXEL_SECRET) def test_auth_failed(self): VoxelMockHttp.type = 'UNAUTHORIZED' try: self.driver.list_nodes() except Exception, e: self.assertTrue(isinstance(e, InvalidCredsError)) else:
def setUp(self): Voxel.connectionCls.conn_classes = (None, VoxelMockHttp) VoxelMockHttp.type = None self.driver = Voxel(VOXEL_KEY, VOXEL_SECRET)