def _make_backup(self): source_dir = os.path.join(TEST_DIR, 'test-dir') target_dir = os.path.join(TEST_DIR, 'backups') # Backup source = Source(source_dir, target_dir) source.backup()
def execute(self): source = Source(self.args['source_dir'], self.args['target_dir']) source_list = SourceList() if source in source_list: raise CommandError("such source already exists") source.backup() source_list.add(source) source_list.update() print("the source has been added successfully")