本文整理汇总了Python中dbbackup.tests.utils.HANDLED_FILES.clean方法的典型用法代码示例。如果您正苦于以下问题:Python HANDLED_FILES.clean方法的具体用法?Python HANDLED_FILES.clean怎么用?Python HANDLED_FILES.clean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbbackup.tests.utils.HANDLED_FILES
的用法示例。
在下文中一共展示了HANDLED_FILES.clean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
if six.PY3:
self.skipTest("Compression isn't implemented in Python3")
HANDLED_FILES.clean()
cmd = ('gpg --import %s' % GPG_PUBLIC_PATH).split()
subprocess.call(cmd, stdout=DEV_NULL, stderr=DEV_NULL)
open(TEST_DATABASE['NAME'], 'a').close()
示例2: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.storage = get_storage()
# foodb files
HANDLED_FILES['written_files'] += [
(utils.filename_generate(ext, 'foodb'), None) for ext in
('db', 'db.gz', 'db.gpg', 'db.gz.gpg')
]
HANDLED_FILES['written_files'] += [
(utils.filename_generate(ext, 'hamdb', 'fooserver'), None) for ext in
('db', 'db.gz', 'db.gpg', 'db.gz.gpg')
]
# Media file
HANDLED_FILES['written_files'] += [
(utils.filename_generate(ext, None, None, 'media'), None) for ext in
('tar', 'tar.gz', 'tar.gpg', 'tar.gz.gpg')
]
HANDLED_FILES['written_files'] += [
(utils.filename_generate(ext, 'bardb', 'barserver'), None) for ext in
('db', 'db.gz', 'db.gpg', 'db.gz.gpg')
]
# barserver files
HANDLED_FILES['written_files'] += [
('file_without_date', None)
]
示例3: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.command = DbbackupCommand()
self.command.servername = 'foo-server'
self.command.storage = get_storage()
self.command.stdout = DEV_NULL
self.command.compress = False
self.command.encrypt = False
self.command.path = None
self.command.media_storage = get_storage_class()()
示例4: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.command = DbbackupCommand()
self.command.stdout = DEV_NULL
self.command.encrypt = False
self.command.compress = False
self.command.servername = 'foo-server'
self.command.storage = FakeStorage()
HANDLED_FILES['written_files'] = [(f, None) for f in [
'2015-02-06-042810.bak',
'2015-02-07-042810.bak',
'2015-02-08-042810.bak',
]]
示例5: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
self.command = DbrestoreCommand()
self.command.stdout = DEV_NULL
self.command.uncompress = False
self.command.decrypt = False
self.command.backup_extension = 'bak'
self.command.filename = 'foofile'
self.command.database = TEST_DATABASE
self.command.passphrase = None
self.command.interactive = True
self.command.storage = FakeStorage()
self.command.connector = get_connector()
HANDLED_FILES.clean()
示例6: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
self.command = DbrestoreCommand()
self.command.stdout = DEV_NULL
self.command.uncompress = False
self.command.decrypt = False
self.command.backup_extension = 'bak'
self.command.filepath = 'foofile'
self.command.database = TEST_DATABASE
self.command.dbcommands = DBCommands(TEST_DATABASE)
self.command.passphrase = None
self.command.storage = FakeStorage()
HANDLED_FILES.clean()
cmd = ('gpg --import %s' % GPG_PRIVATE_PATH).split()
subprocess.call(cmd, stdout=DEV_NULL, stderr=DEV_NULL)
示例7: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
self.command = DbrestoreCommand()
self.command.stdout = DEV_NULL
self.command.uncompress = False
self.command.decrypt = False
self.command.backup_extension = "bak"
self.command.filepath = "foofile"
self.command.database = TEST_MONGODB
self.command.dbcommands = MongoDBCommands(TEST_MONGODB)
self.command.passphrase = None
self.command.interactive = True
self.command.storage = FakeStorage()
HANDLED_FILES.clean()
add_private_gpg()
示例8: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.storage = FakeStorage()
HANDLED_FILES['written_files'] += [
(utils.filename_generate(ext, 'foo'), None) for ext in
('db', 'db.gz', 'db.gpg', 'db.gz.gpg')
]
HANDLED_FILES['written_files'] += [
(utils.filename_generate(ext, 'foo', None, 'media'), None) for ext in
('media', 'media.gz', 'media.gpg', 'media.gz.gpg')
]
HANDLED_FILES['written_files'] += [
('file_without_date', None)
]
示例9: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.command = BaseDbBackupCommand()
self.command.stdout = DEV_NULL
self.command.encrypt = False
self.command.compress = False
self.command.servername = 'foo-server'
self.command.storage = get_storage()
HANDLED_FILES['written_files'] = [(f, None) for f in [
'2015-02-06-042810.tar',
'2015-02-07-042810.tar',
'2015-02-08-042810.tar',
'foodb-2015-02-06-042810.dump',
'foodb-2015-02-07-042810.dump',
'foodb-2015-02-08-042810.dump',
]]
示例10: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.command = DbbackupCommand()
self.command.servername = "foo-server"
self.command.storage = FakeStorage()
self.command.stdout = DEV_NULL
示例11: tearDown
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def tearDown(self):
HANDLED_FILES.clean()
示例12: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
cmd = ('gpg --import %s' % GPG_PUBLIC_PATH).split()
subprocess.call(cmd, stdout=DEV_NULL, stderr=DEV_NULL)
open(TEST_DATABASE['NAME'], 'a').close()
示例13: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
add_public_gpg()
add_private_gpg()
open(TEST_DATABASE['NAME'], 'a').close()
示例14: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
self.command = BaseDbBackupCommand()
self.command.storage = get_storage()
示例15: setUp
# 需要导入模块: from dbbackup.tests.utils import HANDLED_FILES [as 别名]
# 或者: from dbbackup.tests.utils.HANDLED_FILES import clean [as 别名]
def setUp(self):
HANDLED_FILES.clean()
add_public_gpg()
add_private_gpg()
open(TEST_DATABASE['NAME'], 'a').close()
self.instance = models.CharModel.objects.create(field='foo')