Code Monkey home page Code Monkey logo

Comments (16)

gsong avatar gsong commented on June 23, 2024

Will check this out shortly.

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

Thanks!

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

@amotl Hmm, I couldn't reproduce this:

In [20]: from epo_ops import Client

In [21]: from epo_ops.models import Docdb

In [22]: c = Client('key', 'secret')

In [23]: response = c.family("publication", Docdb("1000000", "EP", "A1"), constituents=['biblio
    ...: ', 'legal'])

In [24]: response.status_code
Out[24]: 200

Does that match your expectation?

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

Thanks, I will check this again.

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

After pulling the most recent changes from development, I can confirm all tests are succeeding

pytest -s -v --cov-report term --cov epo_ops tests

especially the tests added to cover the topic #33/#34.

tests/test_api.py::test_family[default_client] PASSED
tests/test_api.py::test_family_biblio[default_client] PASSED
tests/test_api.py::test_family_legal[default_client] PASSED

So, I am puzzled why PatZilla would croak on that. Investigating...


However, those two guys fail

tests/test_ops_quota.py::test_mock_quota_exceeded[cached_client] FAILED
tests/test_ops_quota.py::test_mock_quota_exceeded[default_client] FAILED

which is totally unrelated to this issue, so this is just FYI.

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

@amotl In order to successfully execute the mock tests, you'll need to get an apiary URL as specified in https://github.com/55minutes/python-epo-ops-client#tests.

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

You can always refer to travis as well.

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

In order to successfully execute the mock tests, you'll need to get an apiary URL

I see, thanks. I was running them against production by using

export APIARY_URL=https://ops.epo.org/

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

@amotl Can you try APIARY_URL=http://private-anon-111333769e-opsv31.apiary-mock.com?

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

That works perfectly and also makes the mock tests pass. Thanks!

However, regarding the subtle change required from #33/#34, we obviously preferred running the tests against the real API.

As we see everything should be fine with python-epo-ops-client in this regard, we will now check what might be going wrong with the integration into PatZilla.

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

@amotl Only the EPO failure cases (quota exceeded per day/week) hit the mock API url, as there's no way to simulate that directly at OPS (they don't have a staging server with failure simulation URLs, as far as I know). Everything else hits the actual OPS end points, that's why the OPS key and secret is required for testing.

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

You can see what Apiary mocks: https://opsv31.docs.apiary.io/.

Also thanks for testing, I'll document the anonymous URL in the project docs.

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

Only the EPO failure cases (quota exceeded per day/week) hit the mock API url.

Thank you very much for letting us know about this important detail. So, there's no reason not to run the tests against the Apiary endpoint.

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

Regarding the TypeError, we just have been able to find out about the root cause. It was totally our fault, as we have been bitten by a custom routine monkeypatching the _make_request method of epo-ops-client [1]. Oh my! ;]

If you are curious, the only thing we changed to that method is that we didn't want to invoke raise_for_status().

# Let errors propagate. Don't croak on anything status >= 400.
#response.raise_for_status()

[1] https://github.com/ip-tools/ip-navigator/blob/6f35752e128f0c3138a306d8bce75199c0808cd6/patzilla/access/epo/ops/client.py#L105-L127

from python-epo-ops-client.

gsong avatar gsong commented on June 23, 2024

@amotl Feel free to file an enhancement issue and I can think about how best to allow that behavior to be toggle-able.

from python-epo-ops-client.

amotl avatar amotl commented on June 23, 2024

Thanks again!

from python-epo-ops-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.