Example #1
0
    def run(self):
        try:
            stats = self.repo.pull(
                targets=self.args.targets,
                jobs=self.args.jobs,
                remote=self.args.remote,
                all_branches=self.args.all_branches,
                all_tags=self.args.all_tags,
                with_deps=self.args.with_deps,
                force=self.args.force,
                recursive=self.args.recursive,
            )
            log_summary(stats)
        except (CheckoutError, DvcException) as exc:
            log_summary(getattr(exc, "stats", {}))
            logger.exception("failed to pull data from the cloud")
            return 1

        self.check_up_to_date(stats["downloaded"])
        return 0
Example #2
0
 def _assert_output(stats, expected_text):
     with caplog.at_level(logging.INFO, logger="dvc"):
         caplog.clear()
         log_summary(stats)
         assert expected_text in caplog.text