Skip to content

Commit

Permalink
Implement Discoverer class and lazy loading method for API resources (#…
Browse files Browse the repository at this point in the history
…220)

* Remove resource container and implement Discoverer class

This will allow us to implement different strategies for discovering
API resources i.e. all requests at beginning, completely lazy,
background loading.

* Remove resource container unit test

* Add back line for ResourceList kind

* Add cache updating when resources are requested in __iter__ method

* Add back case where there is no match for _type field in JSONDecoder

* Change flag to for update cache to a field of Discoverer

* Add pytest unit test for discoverer

* Use generic get method for Discoverer subclasses

Only the logic for search needs to change between discoverers,
     so the get function is now defined in the Discoverer
     class instead of in each subclass

Signed-off-by: Fabian von Feilitzsch <[email protected]>

* Update unit tests for discoverers

- Use request fixture to get the discoverer in the client fixture
- Minor style changes

Signed-off-by: Fabian von Feilitzsch <[email protected]>
  • Loading branch information
asetty authored and fabianvf committed Dec 13, 2018
1 parent 53f7c6a commit 307dd81
Show file tree
Hide file tree
Showing 2 changed files with 298 additions and 147 deletions.
Loading

0 comments on commit 307dd81

Please sign in to comment.