Skip to content
This repository was archived by the owner on Jan 27, 2022. It is now read-only.

Restructuring #7

Merged
merged 3 commits into from
Jul 16, 2020
Merged

Restructuring #7

merged 3 commits into from
Jul 16, 2020

Conversation

kmpaul
Copy link
Contributor

@kmpaul kmpaul commented Jul 16, 2020

This PR:

  1. restructures the code to add functional initialization of the app,
  2. breaks out functional elements into their own modules (views, middleware, etc.), and
  3. adds testing.

The tests could not be done with fastapi.testing.TestClient. It turns out that there is an open bug in Starlette that has been open for over a year (encode/starlette#472), which prevents mixing middleware and Jinja2 TemplateResponse object together. The code works fine, but the unit testing fails with FastAPI's TestClient. The workaround (fastapi/fastapi#806) is to use the async-asgi-testclient package for testing.

@codecov
Copy link

codecov bot commented Jul 16, 2020

Codecov Report

Merging #7 into master will increase coverage by 10.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           master        #7       +/-   ##
============================================
+ Coverage   89.79%   100.00%   +10.20%     
============================================
  Files           2         6        +4     
  Lines          49        95       +46     
============================================
+ Hits           44        95       +51     
+ Misses          5         0        -5     
Impacted Files Coverage Δ
tests/test_middleware.py 100.00% <100.00%> (ø)
tests/test_views.py 100.00% <100.00%> (ø)
xdevbot/__init__.py 100.00% <100.00%> (+23.80%) ⬆️
xdevbot/initialization.py 100.00% <100.00%> (ø)
xdevbot/middleware.py 100.00% <100.00%> (ø)
xdevbot/views.py 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57ad7e5...a83d098. Read the comment docs.

@kmpaul kmpaul merged commit f37b301 into NCAR:master Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant