def test_query_tables_top(self):
        table_id = getUniqueTestRunID()
        for i in xrange(20):
            self.tc.create_table(table_id + str(i))

        res = self.tc.query_tables(top = 5)
        self.assertEqual(len(res), 5)
示例#2
0
    def setUp(self):
        self.queue_client = QueueService(
            account_name=credentials.getStorageServicesName(),
            account_key=credentials.getStorageServicesKey())

        proxy_host = credentials.getProxyHost()
        proxy_port = credentials.getProxyPort()
        if proxy_host:
            self.queue_client.set_proxy(proxy_host, proxy_port)

        __uid = getUniqueTestRunID()

        queue_base_name = u'%s' % (__uid)
        self.test_queues = []
        self.creatable_queues = []
        for i in range(10):
            self.test_queues.append(
                TEST_QUEUE_PREFIX + str(i) +
                getUniqueNameBasedOnCurrentTime(queue_base_name))
        for i in range(4):
            self.creatable_queues.append(
                'mycreatablequeue' + str(i) +
                getUniqueNameBasedOnCurrentTime(queue_base_name))
        for queue_name in self.test_queues:
            self.queue_client.create_queue(queue_name)
    def test_query_tables_top(self):
        table_id = getUniqueTestRunID()
        for i in xrange(20):
            self.tc.create_table(table_id + str(i))

        res = self.tc.query_tables(top=5)
        self.assertEqual(len(res), 5)
    def setUp(self):
        self.tc = TableService(account_name=credentials.getStorageServicesName().encode('ascii', 'ignore'), 
                                   account_key=credentials.getStorageServicesKey().encode('ascii', 'ignore'))

        __uid = getUniqueTestRunID()
        test_table_base_name = u'testtable%s' % (__uid)
        self.test_table = getUniqueNameBasedOnCurrentTime(test_table_base_name)     
        self.tc.create_table(self.test_table)
示例#5
0
    def setUp(self):
        self.tc = TableService(account_name=credentials.getStorageServicesName(), 
                                   account_key=credentials.getStorageServicesKey())

        __uid = getUniqueTestRunID()
        table_base_name = u'testtable%s' % (__uid)
        self.table_name = getUniqueNameBasedOnCurrentTime(table_base_name)     
        self.additional_table_names = []
    def setUp(self):
        self.tc = TableService(
            account_name=credentials.getStorageServicesName().encode(
                'ascii', 'ignore'),
            account_key=credentials.getStorageServicesKey().encode(
                'ascii', 'ignore'))

        __uid = getUniqueTestRunID()
        test_table_base_name = u'testtable%s' % (__uid)
        self.test_table = getUniqueNameBasedOnCurrentTime(test_table_base_name)
        self.tc.create_table(self.test_table)
    def setUp(self):
        self.tc = TableService(account_name=credentials.getStorageServicesName(), 
                                   account_key=credentials.getStorageServicesKey())

        proxy_host = credentials.getProxyHost()
        proxy_port = credentials.getProxyPort()
        if proxy_host:
            self.tc.set_proxy(proxy_host, proxy_port)

        __uid = getUniqueTestRunID()
        table_base_name = u'testtable%s' % (__uid)
        self.table_name = getUniqueNameBasedOnCurrentTime(table_base_name)     
        self.additional_table_names = []
示例#8
0
    def setUp(self):
        self.tc = TableService(
            account_name=credentials.getStorageServicesName(),
            account_key=credentials.getStorageServicesKey())

        proxy_host = credentials.getProxyHost()
        proxy_port = credentials.getProxyPort()
        if proxy_host:
            self.tc.set_proxy(proxy_host, proxy_port)

        __uid = getUniqueTestRunID()
        table_base_name = u'testtable%s' % (__uid)
        self.table_name = getUniqueNameBasedOnCurrentTime(table_base_name)
        self.additional_table_names = []
示例#9
0
    def setUp(self):
        self.sbs = ServiceBusService(credentials.getServiceBusNamespace(),
                                     credentials.getServiceBusKey(), 'owner')

        proxy_host = credentials.getProxyHost()
        proxy_port = credentials.getProxyPort()
        if proxy_host:
            self.sbs.set_proxy(proxy_host, proxy_port)

        __uid = getUniqueTestRunID()

        queue_base_name = u'mytestqueue%s' % (__uid)
        topic_base_name = u'mytesttopic%s' % (__uid)

        self.queue_name = getUniqueNameBasedOnCurrentTime(queue_base_name)
        self.topic_name = getUniqueNameBasedOnCurrentTime(topic_base_name)

        self.additional_queue_names = []
        self.additional_topic_names = []
    def setUp(self):
        self.sbs = ServiceBusService(credentials.getServiceBusNamespace(), 
                                     credentials.getServiceBusKey(), 
                                     'owner')

        proxy_host = credentials.getProxyHost()
        proxy_port = credentials.getProxyPort()
        if proxy_host:
            self.sbs.set_proxy(proxy_host, proxy_port)

        __uid = getUniqueTestRunID()

        queue_base_name = u'mytestqueue%s' % (__uid)
        topic_base_name = u'mytesttopic%s' % (__uid)

        self.queue_name = getUniqueNameBasedOnCurrentTime(queue_base_name)
        self.topic_name = getUniqueNameBasedOnCurrentTime(topic_base_name)

        self.additional_queue_names = []
        self.additional_topic_names = []
    def setUp(self):
        self.queue_client = QueueService(account_name=credentials.getStorageServicesName(), 
                                                account_key=credentials.getStorageServicesKey())

        proxy_host = credentials.getProxyHost()
        proxy_port = credentials.getProxyPort()
        if proxy_host:
            self.queue_client.set_proxy(proxy_host, proxy_port)

        __uid = getUniqueTestRunID()

        queue_base_name = u'%s' % (__uid)
        self.test_queues = []
        self.creatable_queues = []
        for i in range(10):
            self.test_queues.append(TEST_QUEUE_PREFIX + str(i) + getUniqueNameBasedOnCurrentTime(queue_base_name))
        for i in range(4):
            self.creatable_queues.append('mycreatablequeue' + str(i) + getUniqueNameBasedOnCurrentTime(queue_base_name))
        for queue_name in self.test_queues:
            self.queue_client.create_queue(queue_name)

from azuretest.util import (credentials, 
                            getUniqueTestRunID,
                            STATUS_OK,
                            STATUS_CREATED,
                            STATUS_ACCEPTED,
                            STATUS_NO_CONTENT,
                            getUniqueNameBasedOnCurrentTime)

import unittest
import time
from datetime import datetime

#------------------------------------------------------------------------------
__uid = getUniqueTestRunID()

TABLE_TO_DELETE = 'mytesttabletodelete%s' % (__uid)
TABLE_NO_DELETE = 'mytesttablenodelete%s' % (__uid)
ENTITY_TO_DELETE = 'mytestentitytodelete%s' % (__uid)
ENTITY_NO_DELETE = 'mytestentitynodelete%s' % (__uid)
BATCH_TABLE = 'mytestbatchtable%s' % (__uid)
FILTER_TABLE = 'mytestfiltertable%s' % (__uid)
#------------------------------------------------------------------------------
class StorageTest(unittest.TestCase):
    '''
    TODO:
    - comprehensive, positive test cases for all table client methods
    - comprehensive, negative test cases all table client methods
    - missing coverage for begin_batch
    - missing coverage for cancel_batch
#--------------------------------------------------------------------------

from azure.storage.tableservice import *
from azure.storage import EntityProperty, Entity, StorageServiceProperties
from azure import WindowsAzureError

from azuretest.util import (credentials, getUniqueTestRunID, STATUS_OK,
                            STATUS_CREATED, STATUS_ACCEPTED, STATUS_NO_CONTENT,
                            getUniqueNameBasedOnCurrentTime)

import unittest
import time
from datetime import datetime

#------------------------------------------------------------------------------
__uid = getUniqueTestRunID()

TABLE_TO_DELETE = 'mytesttabletodelete%s' % (__uid)
TABLE_NO_DELETE = 'mytesttablenodelete%s' % (__uid)
ENTITY_TO_DELETE = 'mytestentitytodelete%s' % (__uid)
ENTITY_NO_DELETE = 'mytestentitynodelete%s' % (__uid)
BATCH_TABLE = 'mytestbatchtable%s' % (__uid)
FILTER_TABLE = 'mytestfiltertable%s' % (__uid)


#------------------------------------------------------------------------------
class StorageTest(unittest.TestCase):
    '''
    TODO:
    - comprehensive, positive test cases for all table client methods
    - comprehensive, negative test cases all table client methods