

@mock.patch(exists_path, mock.Mock(return_value=True))
@mock.patch(getsize_path, mock.Mock(return_value=42))
@mock.patch(find_git_root_path, mock.Mock(return_value='./'))
def test_puts_error_when_wercker_json_could_not_be_opened(self):
    e = IOError('foo')
    with mock.patch(open_path, mock.Mock(side_effect=e)) as open_file:
        with mock.patch(puts_path, mock.Mock()) as puts:
            validate()
            open_file.assert_called_once()
            puts.assert_called_with(SubstringMatcher(containing='Error while reading wercker.json file:'))

dataset/ETHPy150Open wercker/wercker-cli/werckercli/tests/commands/test_validate.py ValidationTests.test_puts_error_when_wercker_json_could_not_be_opened/original