Skip to content

Commit 2e64d99

Browse files
authored
Merge pull request #114 from TotallyNotRobots/gonzobot+fix-horoscope-test
Fix horoscope test error matching
2 parents 8ed3c58 + 33fd38c commit 2e64d99

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88
### Changed
99
- Refactor tests to remove dependency on mock library
10+
### Fixed
11+
- Fix matching exception in horoscope test
1012

1113
## [1.3.0] 2020-03-17
1214
### Added

tests/plugin_tests/test_horoscope.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ def test_page_error(mock_requests, mock_db):
129129
bot = MagicMock()
130130
bot.user_agent = "Some user agent"
131131

132+
mock_requests.add('GET', URL.format(sign=1), status=404)
133+
132134
with pytest.raises(requests.RequestException):
133135
horoscope.horoscope('aries', sess, bot, 'some_user', event)
134136

135137
event.reply.assert_called_once_with(
136-
"Could not get horoscope: Connection refused by Responses: GET "
137-
+ URL.format(sign=1)
138-
+ " doesn't match Responses Mock. URL Error"
138+
"Could not get horoscope: 404 Client Error: Not Found for url: {}. URL Error".format(URL.format(sign=1))
139139
)

0 commit comments

Comments
 (0)