当前位置: 首页>>代码示例>>Python>>正文


Python base.TestCase方法代码示例

本文整理汇总了Python中tests.base.TestCase方法的典型用法代码示例。如果您正苦于以下问题:Python base.TestCase方法的具体用法?Python base.TestCase怎么用?Python base.TestCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.base的用法示例。


在下文中一共展示了base.TestCase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: from tests import base [as 别名]
# 或者: from tests.base import TestCase [as 别名]
def setUp(self):
        base.TestCase.setUp(self)

        users = ({
            'email': '[email protected]',
            'login': 'goodlogin',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        }, {
            'email': '[email protected]',
            'login': 'regularuser',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        })
        self.admin, self.user = [
            self.model('user').createUser(**user) for user in users]
        folders = self.model('folder').childFolders(
            self.admin, 'user', user=self.admin)
        for folder in folders:
            if folder['name'] == 'Public':
                self.publicFolder = folder
        self.item1 = self.model('item').createItem(
            'item1', creator=self.admin, folder=self.publicFolder)
        self.item2 = self.model('item').createItem(
            'item2', creator=self.admin, folder=self.publicFolder) 
开发者ID:OpenGeoscience,项目名称:database_assetstore,代码行数:29,代码来源:file_test.py

示例2: setUp

# 需要导入模块: from tests import base [as 别名]
# 或者: from tests.base import TestCase [as 别名]
def setUp(self):
        base.TestCase.setUp(self)

        adminUser = {
            'email': '[email protected]',
            'login': 'goodlogin',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        }
        self.admin = self.model('user').createUser(**adminUser)
        folders = self.model('folder').childFolders(
            self.admin, 'user', user=self.admin)
        for folder in folders:
            if folder['name'] == 'Public':
                self.publicFolder = folder

        resp = self.request(method='POST', path='/assetstore', user=self.admin,
                            params=self.dbParams)
        self.assertStatusOk(resp)
        self.assetstore1 = resp.json

        params = {
            'parentId': str(self.publicFolder['_id']),
            'parentType': 'folder'
        }
        resp = self.request(
            path='/database_assetstore/%s/import' % str(
                self.assetstore1['_id']),
            method='PUT', user=self.admin, params=params)
        self.assertStatusOk(resp)
        self.dbItem = list(self.model('item').textSearch(
            'permits', user=self.admin, limit=1))[0]
        self.dbFile = list(self.model('item').childFiles(item=self.dbItem))[0]
        self.dbFileId = str(self.dbFile['_id']) 
开发者ID:OpenGeoscience,项目名称:database_assetstore,代码行数:37,代码来源:dbs_mongo_test.py

示例3: setUp

# 需要导入模块: from tests import base [as 别名]
# 或者: from tests.base import TestCase [as 别名]
def setUp(self):
        base.TestCase.setUp(self)

        adminUser = {
            'email': '[email protected]',
            'login': 'goodlogin',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        }
        self.admin = self.model('user').createUser(**adminUser)
        folders = self.model('folder').childFolders(
            self.admin, 'user', user=self.admin)
        for folder in folders:
            if folder['name'] == 'Public':
                self.publicFolder = folder

        resp = self.request(method='POST', path='/assetstore', user=self.admin,
                            params=self.dbParams)
        self.assertStatusOk(resp)
        self.assetstore1 = resp.json

        params = {
            'parentId': str(self.publicFolder['_id']),
            'parentType': 'folder',
            'table': json.dumps([{
                'name': 'drerio_gene_vega__gene__main',
                'database': 'vega_mart_88',
                }]),
        }
        resp = self.request(
            path='/database_assetstore/%s/import' % str(
                self.assetstore1['_id']),
            method='PUT', user=self.admin, params=params)
        self.assertStatusOk(resp)
        self.dbItem = list(self.model('item').textSearch(
            'drerio_gene_vega__gene__main', user=self.admin, limit=1))[0]
        self.dbFile = list(self.model('item').childFiles(item=self.dbItem))[0]
        self.dbFileId = str(self.dbFile['_id']) 
开发者ID:OpenGeoscience,项目名称:database_assetstore,代码行数:41,代码来源:dbs_mysql_test.py

示例4: setUp

# 需要导入模块: from tests import base [as 别名]
# 或者: from tests.base import TestCase [as 别名]
def setUp(self):
        # adding and removing docker images and using generated rest endpoints
        # requires admin access
        base.TestCase.setUp(self)
        admin = {
            'email': '[email protected]',
            'login': 'adminlogin',
            'firstName': 'Admin',
            'lastName': 'Last',
            'password': 'adminpassword',
            'admin': True
        }
        self.admin = self.model('user').createUser(**admin) 
开发者ID:girder,项目名称:slicer_cli_web,代码行数:15,代码来源:docker_test.py

示例5: setUp

# 需要导入模块: from tests import base [as 别名]
# 或者: from tests.base import TestCase [as 别名]
def setUp(self):
        base.TestCase.setUp(self)

        users = ({
            'email': '[email protected]',
            'login': 'goodlogin',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        }, {
            'email': '[email protected]',
            'login': 'regularuser',
            'firstName': 'First',
            'lastName': 'Last',
            'password': 'goodpassword'
        })
        self.admin, self.user = [
            self.model('user').createUser(**user) for user in users]
        folders = self.model('folder').childFolders(
            self.admin, 'user', user=self.admin)
        for folder in folders:
            if folder['name'] == 'Public':
                self.publicFolder = folder
            elif folder['name'] == 'Private':
                self.privateFolder = folder
        self.item1 = self.model('item').createItem(
            'item1', creator=self.admin, folder=self.publicFolder)
        self.item2 = self.model('item').createItem(
            'item2', creator=self.admin, folder=self.publicFolder)
        # Define locations for the default assetstores
        self.dbParams = {
            'type': AssetstoreType.DATABASE,
            'name': 'Test Assetstore',
            'dbtype': 'sqlalchemy_postgres',
            'dburi': os.environ.get(
                'GIRDER_DATABASE_ASSETSTORE_POSTGRES_DB',
                'postgresql://[email protected]/sampledb'),
        }
        self.dbParams2 = {
            'type': AssetstoreType.DATABASE,
            'name': 'All Mongo Assetstores',
            'dburi': '/'.join(os.environ.get('GIRDER_TEST_DB').split('/')[:-1])
        }
        self.dbParams3 = {
            'type': AssetstoreType.DATABASE,
            'name': 'One Mongo Assetstores',
            'dburi': os.environ.get('GIRDER_TEST_DB')
        } 
开发者ID:OpenGeoscience,项目名称:database_assetstore,代码行数:50,代码来源:assetstore_test.py


注:本文中的tests.base.TestCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。