예제 #1
0
    def test_restore_rdiff_increment(self):
        destination_dir = os.path.join(tempdir, 'restore')
        rb2a.restore_rdiff_increment(rdiffrepo, destination_dir, '2015-10-01T08:00:00')

        with open(os.path.join(tempdir, 'restore', 'data')) as f:
            data = f.read()

        shutil.rmtree(destination_dir)

        self.assertEqual(data, 'first')
예제 #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')