def test_conflict(self, mocked_logger): """ Default HTTP 409 with errors """ base = BaseController() with pytest.raises(web.HTTPConflict) as expected: base.conflict() mocked_logger.assert_called_once() assert expected.value.status == 409
def test_conflict_error(self): base = BaseController() base.conflict = MagicMock('aaa') base.handle_business_errors(ConflictError('conflict')) base.conflict.assert_called_with()