diff --git a/.gitignore b/.gitignore index ef26c2fd..d65c8cfc 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ target/ *.ipynb fabhosts.py tox.ini +celerybeat.pid +celerybeat-schedule diff --git a/celerybeat-schedule b/celerybeat-schedule deleted file mode 100644 index 72d47ecc..00000000 Binary files a/celerybeat-schedule and /dev/null differ diff --git a/requirements/core.txt b/requirements/core.txt index 85edab4b..0a1da252 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -30,7 +30,7 @@ arrow==0.6.0 beautifulsoup4==4.4.0 blinker==1.3 docopt==0.6.2 -ipaddress==1.0.9 +ipaddress==1.0.10 itsdangerous==0.24 Jinja2==2.7.3 Mako==1.0.1 diff --git a/tests/fixture/h2oline_soup_get_dt_cfs b/tests/fixture/h2oline_soup_get_dt_cfs new file mode 100644 index 00000000..e71f44bf --- /dev/null +++ b/tests/fixture/h2oline_soup_get_dt_cfs @@ -0,0 +1,85 @@ +interactions: +- request: + body: null + headers: + Accept: ['*/*'] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + User-Agent: [python-requests/2.6.0 CPython/2.7.9 Darwin/14.4.0] + method: GET + uri: http://www.h2oline.com/default.aspx?pg=si&op=235127 + response: + body: {string: !!python/unicode "\r\n\r\n\r\n\r\n\tSite + 235127\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n
\r\n\r\n
\r\n\r\n\t
\r\n\t\t
\r\n\t\t\t\r\n\t\t\t
\r\n\t\r\n\t\t\t\t
\r\n\t\t\t\tFlowCast©
\r\n\t\t\t\r\n
\r\n\t\t\t\r\n\t\t\tWaterline Home | State + Site Code Index | 800 Report Numbers | FlowCast© Sites | Printable + PDF

Back to Brookfield Renewable + Power | Back to Maine\r\n\t\t
\r\n\t
\r\n\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\r\n\t\t\t\r\n \r\n + \ \r\n
\r\n

\r\n 235127 RAPID RIVER MIDDLE DAM ON RICHARDSON LAKE, ME
PUBLISHED ON JUL 13, 2015 AT 06:31:27 - EXPIRES JUL + 13 11:59 PM
\r\n

\r\n
\r\n\r\n\r\n\r\n \r\n \r\n + \
\r\n

\r\n
\r\n + For the Rapid River at Brookfield Renewable Power's Middle Dam on Richardson + Lake in ME


At 7:10 PM Sun JUL 12, the total flow below the dam + was 800 CFS
Readings available for this flow have not changed significantly + as of 6:28 AM today

The following forecast for flows below the dam + is based on the most recent load forecast from the New England Independent + System operator which schedules and dispatches generation throughout the + region:
Until 11:59 PM today, Mon, 800 CFS

Flows will often + differ from this forecast for reasons beyond the company's control including + regional energy demand and clearing price, system operating conditions, equipment + failures and weather.

All published flows are approximate and forecasts + are estimates only. Actual flows will vary and can change quickly at any time. + Always be alert and wear an approved flotation device. Never go in or near + the water until you know and accept the risks you are assuming by being in + this area!

For current flood potential, flood conditions, or flood + forecasts please contact the Oxford County Emergency Management Agency at + (207) 743-6336.




ANNUAL + RELEASE using pdf FOR 2015
\r\n

\r\n
\r\n
\r\n\t\t\t\r\n\t\t\r\n
\r\n\t\t\r\n\t
\r\n\r\n\t
\r\n\t\t
\r\n\t\t\tWaterline Home | State Site Code Index | 800 + Report Numbers | FlowCast© + Sites | Printable + PDF\r\n\t\t\t

\r\n\t\t\t\r\n\t\t\t\tWaterline is an electronic publication of Virtual Publishing + LLC.
Copyright © 1992 - 2015 Virtual Publishing LLC All Rights Reserved
http://www.h2oline.com
\r\n\t\t\t
\r\n\r\n\t\t
\r\n\t
\r\n\r\n\r\n
\r\n\r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n\t\r\n\r\n"} + headers: + cache-control: [no-cache] + content-length: ['9497'] + content-type: [text/html; charset=utf-8] + date: ['Mon, 13 Jul 2015 10:35:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/7.5] + x-aspnet-version: [2.0.50727] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +version: 1 diff --git a/tests/test_remote_h2oline.py b/tests/test_remote_h2oline.py index 1568d9c8..1af96db1 100644 --- a/tests/test_remote_h2oline.py +++ b/tests/test_remote_h2oline.py @@ -33,3 +33,10 @@ def test_get_dt_cfs(self): dt, value = h2oline.get_dt_cfs(self.SITE_NUM) assert type(dt) == datetime.datetime assert type(value) == float + + @my_vcr.use_cassette('tests/fixture/h2oline_soup_get_dt_cfs') + def test_soup_get_dt_cfs(self): + soup = h2oline.get_soup(self.SITE_NUM) + dt, value = h2oline.get_dt_cfs(self.SITE_NUM, soup=soup) + assert type(dt) == datetime.datetime + assert type(value) == float