def test__backup(self): def fake_copytree(source, target): pass orig_copytree = shutil.copytree shutil.copytree = fake_copytree proj = Project("test_project", record_store=MockRecordStore()) backup_dir = proj.backup() shutil.copytree = orig_copytree assert "backup" in backup_dir