本文整理匯總了Python中dbbackup.tests.utils.HANDLED_FILES類的典型用法代碼示例。如果您正苦於以下問題:Python HANDLED_FILES類的具體用法?Python HANDLED_FILES怎麽用?Python HANDLED_FILES使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了HANDLED_FILES類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
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
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
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
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
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
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
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
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
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
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
def tearDown(self):
HANDLED_FILES.clean()
示例12: setUp
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
def setUp(self):
HANDLED_FILES.clean()
add_public_gpg()
add_private_gpg()
open(TEST_DATABASE['NAME'], 'a').close()
示例14: setUp
def setUp(self):
HANDLED_FILES.clean()
self.command = BaseDbBackupCommand()
self.command.storage = get_storage()
示例15: setUp
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')