Skip to content
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

Add request parameters #54

Merged
merged 5 commits into from
Aug 14, 2019
Merged

Add request parameters #54

merged 5 commits into from
Aug 14, 2019

Conversation

MJGaughran
Copy link
Contributor

The Fetcher class now provides the ability to set additional parameters used during archiver retrieval. This has been used by the AaFetcher (Archiver Appliance) subclass, in particular.

The motivation for this was to enable the retiredPVTemplate parameter to be set for Archiver Appliance retrieval.

I have also modified the unit test that checks the url construction to use the public method 'get_values', as I thought it better to test the public interface. Please let me know your opinion on this.

expected = 'dummy-url?pv=dummy&from=2001-01-01T01:01:00Z&to=2010-02-03T04:05:00Z'
assert constructed == expected

with mock.patch('requests.get') as mock_get:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that you decided to mock and call get_values() rather than calling _construct_url().

Copy link
Contributor Author

@MJGaughran MJGaughran Aug 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I mentioned this bit in the pull request description rather than the commit message!

I was trying to test whether providing request_params results in the correct URL being sent. Testing _construct_url() doesn't really check for this, as it is not part of the public interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's a bit strange that I mocked out _parse_raw_data(), but that's because these tests are applied to an abstract class. I didn't want to make the pull request too big!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, so you did.

I think testing the public API is probably better.

@willrogers
Copy link
Member

The only question now is why has tox broken?

@coveralls
Copy link

coveralls commented Aug 14, 2019

Pull Request Test Coverage Report for Build 386

  • 18 of 18 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 97.743%

Totals Coverage Status
Change from base Build 382: 0.02%
Covered Lines: 563
Relevant Lines: 576

💛 - Coveralls

@willrogers willrogers merged commit 750a868 into master Aug 14, 2019
@willrogers willrogers deleted the add-request-params branch August 14, 2019 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants