class MediabackupCleanUpOldBackupsTest(TestCase):
    def setUp(self):
        self.skipTest("Doesn't work!")
        self.command = DbbackupCommand()
        self.command.servername = "foo-server"
        self.command.storage = FakeStorage()

    def test_func(self):
        self.command.cleanup_old_backups()
class MediabackupCleanUpOldBackupsTest(TestCase):
    def setUp(self):
        self.skipTest("Doesn't work!")
        self.command = DbbackupCommand()
        self.command.servername = 'foo-server'
        self.command.storage = FakeStorage()

    def test_func(self):
        self.command.cleanup_old_backups()
示例#3
0
class MediabackupCleanUpOldBackupsTest(TestCase):
    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',
        ]]

    @patch('dbbackup.settings.CLEANUP_KEEP_MEDIA', 1)
    def test_func(self):
        self.command.cleanup_old_backups()
        self.assertEqual(2, len(HANDLED_FILES['deleted_files']))
示例#4
0
class MediabackupCleanUpOldBackupsTest(TestCase):
    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',
        ]]

    @patch('dbbackup.settings.CLEANUP_KEEP_MEDIA', 1)
    def test_func(self):
        self.command.cleanup_old_backups()
        self.assertEqual(2, len(HANDLED_FILES['deleted_files']))