-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A443570919790955 tenders tests #11
base: tests
Are you sure you want to change the base?
A443570919790955 tenders tests #11
Conversation
9d95eaf
to
3febc4b
Compare
call('Backward data sync finished.') | ||
] | ||
|
||
def raiser(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mock
допускає MagicMock(return_value=Exeception()
або MagicMock(side_effect=[Exception()])
не потрібно загортати у функцію
call('Start backward data sync worker...') | ||
] | ||
|
||
self.assertEqual(mocked_logger.warn.mock_calls[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для цього є метод assert_called_once_with
self.assertEqual(mocked_logger.warn.mock_calls[0], | ||
call('Backward worker died!', | ||
extra=journal_context({"MESSAGE_ID": DATABRIDGE_WORKER_DIED}, {}))) | ||
self.assertEqual(mocked_logger.exception.mock_calls[0], call(e)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Аналогічно
] | ||
|
||
cb.get_tenders = MagicMock(side_effect=[Exception()]) | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with self.assertRaises(Exception) as e:
cb.get_tender_contracts_backward()
88eeb39
to
af3b3e7
Compare
af3b3e7
to
9ce15b6
Compare
9ce15b6
to
ae29045
Compare
ae29045
to
2a10434
Compare
|
тобто? |
1f86250
to
2a4b77e
Compare
2a4b77e
to
0eb634d
Compare
No description provided.