Пример #1
0
    def test_convert_increment(self):
        attic_dir = os.path.join(tempdir, 'attic')
        subprocess.check_call(['attic', 'init', attic_dir])

        rb2a.convert_increment(rdiffrepo, attic_dir, '2015-10-01T08:00:00')

        archives = rb2a.parse_attic_repo(attic_dir)

        shutil.rmtree(attic_dir)

        self.assertEqual(len(archives), 1)
        self.assertEqual(archives[0], '2015-10-01T08:00:00')
Пример #2
0
    def test_attic_create(self):
        destination_dir = os.path.join(tempdir, 'restore')
        rb2a.restore_rdiff_increment(rdiffrepo, destination_dir, '2015-10-01T08:00:00')

        attic_dir = os.path.join(tempdir, 'attic')
        subprocess.check_call(['attic', 'init', attic_dir])
        rb2a.attic_create(attic_dir, '2015-10-01T08:00:00', destination_dir)

        archives = rb2a.parse_attic_repo(attic_dir)

        shutil.rmtree(attic_dir)
        shutil.rmtree(destination_dir)

        self.assertEqual(len(archives), 1)
        self.assertEqual(archives[0], '2015-10-01T08:00:00')