

@mock.patch(open_path, mock.Mock(return_value=mock.MagicMock()))
@mock.patch(exists_path, mock.Mock(return_value=True))
@mock.patch(find_git_root_path, mock.Mock(return_value='./'))
@mock.patch(getsize_path, mock.Mock(return_value=42))
def test_puts_error_when_wercker_json_is_not_valid(self):
    e = ValueError('foo')
    with mock.patch('json.load', mock.Mock(side_effect=e)) as json_load:
        with mock.patch(puts_path, mock.Mock()) as puts:
            validate()
            json_load.assert_called_once()
            puts.assert_called_with(SubstringMatcher(containing='wercker.json is not valid json: '))

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