def run_upgrade(args): """Run upgrade on master node """ downloader = Downloader(src_path=args.src, dst_path=args.dst, checksum=args.checksum, required_free_space=args.size) downloader.run()
def run_upgrade(args): """Run upgrade on master node """ downloader = Downloader( src_path=args.src, dst_path=args.dst, checksum=args.checksum, required_free_space=args.size) downloader.run()
def test_run_error_in_case_if_disk_does_not_have_enough_space(self, _): kwargs = self.default_args(required_free_space=1000) downloader = Downloader(**kwargs) with patch( 'fuel_update_downloader.downloader.calculate_free_space', return_value=1): self.assertRaisesRegexp( errors.NotEnoughFreeSpace, 'Not enough free space, path - "/tmp/dst_file", ' 'free space - "1", required free space - "1000"', downloader.run)
def test_run_error_in_case_if_md5_sums_are_not_equal( self, download_file_mock): kwargs = self.default_args(required_free_space=1000) downloader = Downloader(**kwargs) with patch( 'fuel_update_downloader.downloader.calculate_md5sum', return_value='wrong_md5_sum'): self.assertRaisesRegexp( errors.WrongChecksum, 'File "/tmp/dst_file" has wrong checkum, actual ' 'checksum "wrong_md5_sum" expected checksum ""', downloader.run)
def test_run_without_errors(self, _, __, ___): downloader = Downloader(**self.default_args()) downloader.run()