Skip to content

add notes for next refactor #235

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions tests/catalog_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import unittest
from textwrap import dedent

import wrapt
import yaml
from mock import patch

Expand All @@ -35,11 +36,27 @@
# setup the mock data
mockApiSetup()

from .catalog_mock_api_responses import BaseTestCase

# httpPostHandlers = BaseTestCase.httpPostHandlers


class TestCatalogGet(BaseTestCase):
@patch("requests.get", side_effect=BaseTestCase.httpGetHandlers)

# TODO: ...
# @patch(
# target="requests.post",
# side_effect=catalog_mocks(
# {"default_login_reponse": "https://127.0.0.1:8080/api/v1/login"}
# ),
# )
@patch("requests.post", side_effect=BaseTestCase.httpPostHandlers)
def test_get_catalog_id_type(self, mock_get, mock_post):
def test_get_catalog_id_type(self, catalog_mocks):

# E.g. mock remote exception response for /api/v1/login
# catalog_mocks.set(
# "https://127.0.0.1:8080/api/v1/login", "remote_exception"
# )

with self.assertRaisesRegexp(
AssertionError, "'id' must be provided and must be a str",
Expand Down