Skip to content

Commit

Permalink
return
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed May 1, 2024
1 parent 65acbe1 commit 7223263
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/steps/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ def download_hugo():
HUGO_BIN_PATH = WORKING_DIR_PATH / HUGO_BIN
run(logger, f'tar -xzf {hugo_tar_path} -C {WORKING_DIR_PATH}', env={}, check=True)
run(logger, f'chmod +x {HUGO_BIN_PATH}', env={}, check=True)
return
except Exception:
failed_attempts += 1
logger.info(
Expand Down
6 changes: 1 addition & 5 deletions test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,7 @@ def test_it_is_callable_retry(self, mock_get_logger, mock_run, patch_working_dir
dict(text='fake-data')
])

result = download_hugo()

assert result == 0
download_hugo()

mock_get_logger.assert_called_once_with('download-hugo')

Expand Down Expand Up @@ -676,8 +674,6 @@ def test_it_calls_hugo_as_expected(self, mock_get_logger, mock_run,

build_hugo(**kwargs)

mock_run.return_value

mock_get_logger.assert_called_once_with('build-hugo')

mock_logger = mock_get_logger.return_value
Expand Down
4 changes: 2 additions & 2 deletions test/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_run_command_failure(mock_popen):
command = 'foobar'
return_code = 2

mock_popen.return_value = Mock(returncode=return_code, stdout=Mock(readline=Mock()))
mock_popen.return_value = Mock(returncode=return_code, stdout=Mock(readline=Mock(return_value='text'))) # noqa: E501

result = run(mock_logger, command)

Expand All @@ -185,7 +185,7 @@ def test_run_command_failure_check_true(mock_popen):
command = 'foobar'
return_code = 2

mock_popen.return_value = Mock(returncode=return_code, stdout=Mock(readline=Mock()))
mock_popen.return_value = Mock(returncode=return_code, stdout=Mock(readline=Mock(return_value='text'))) # noqa: E501

with raises(subprocess.CalledProcessError):
run(mock_logger, command, check=True)
Expand Down

0 comments on commit 7223263

Please sign in to comment.