Merge lp:~facundo/ubuntu-rest-scopes/weatherchannel-no-humid into lp:ubuntu-rest-scopes

Proposed by Facundo Batista
Status: Merged
Approved by: Facundo Batista
Approved revision: 488
Merged at revision: 490
Proposed branch: lp:~facundo/ubuntu-rest-scopes/weatherchannel-no-humid
Merge into: lp:ubuntu-rest-scopes
Diff against target: 1448 lines (+1424/-1)
3 files modified
src/scopes/tests/fixtures/weatherchannel-no-humid.json (+1412/-0)
src/scopes/tests/test_weatherchannel.py (+9/-0)
src/scopes/weatherchannel.py (+3/-1)
To merge this branch: bzr merge lp:~facundo/ubuntu-rest-scopes/weatherchannel-no-humid
Reviewer Review Type Date Requested Status
Bret Barker (community) Approve
Review via email: mp+274895@code.launchpad.net

Commit message

Support forecast without humidity from TWC.

Description of the change

Support forecast without humidity from TWC.

To post a comment you must log in.
Revision history for this message
Bret Barker (noise) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'src/scopes/tests/fixtures/weatherchannel-no-humid.json'
2--- src/scopes/tests/fixtures/weatherchannel-no-humid.json 1970-01-01 00:00:00 +0000
3+++ src/scopes/tests/fixtures/weatherchannel-no-humid.json 2015-10-19 14:12:30 +0000
4@@ -0,0 +1,1412 @@
5+[{"Location":{"key":"UKXX0085",
6+"type":1,
7+"countryCode":"UK",
8+"class":"location",
9+"lat":51.50853,
10+"lng":-0.12574,
11+"elv":56,
12+"tz":0.0,
13+"zoneInfo":"Europe\/London",
14+"name":"London",
15+"city":"London",
16+"state":"GLA",
17+"stateName":"Greater London Authority",
18+"country":"United Kingdom",
19+"forecastID":"03770000",
20+"obsID":"EGLC",
21+"dma":"105",
22+"zoneId":"UK013",
23+"isMarineSurf":"false",
24+"zip":"48768",
25+"parentLoc":"UKXX0085",
26+"cID":""},
27+"DailyForecasts":[{"key":"03770000",
28+"class":"forecast",
29+"validDate":1391713200,
30+"minTemp":7,
31+"precip_type":"rain",
32+"night":{"wSpeed":25,
33+"wDir":200,
34+"pop":100,
35+"uv":0,
36+"icon":12,
37+"wDirText":"SSW",
38+"phrase":"Rain",
39+"bluntPhrase":"Rain",
40+"precip_type":"rain",
41+"snwAccumPhrase":"",
42+"snwAccumPhraseTerse":"",
43+"extQual":"",
44+"weatherCode":"1200"}},
45+{"key":"03770000",
46+"class":"forecast",
47+"validDate":1391799600,
48+"maxTemp":8,
49+"minTemp":6,
50+"precip_type":"rain",
51+"day":{"wSpeed":32,
52+"wDir":257,
53+"pop":90,
54+"uv":1,
55+"icon":12,
56+"wDirText":"WSW",
57+"phrase":"AM Rain",
58+"bluntPhrase":"AM Rain",
59+"precip_type":"rain",
60+"snwAccumPhrase":"",
61+"snwAccumPhraseTerse":"",
62+"extQual":"",
63+"weatherCode":"6303"},
64+"night":{"wSpeed":40,
65+"wDir":187,
66+"pop":100,
67+"uv":0,
68+"icon":12,
69+"wDirText":"S",
70+"phrase":"Rain \/ Wind",
71+"bluntPhrase":"Rain\/Wind",
72+"precip_type":"rain",
73+"snwAccumPhrase":"",
74+"snwAccumPhraseTerse":"",
75+"extQual":"",
76+"weatherCode":"1210"}},
77+{"key":"03770000",
78+"class":"forecast",
79+"validDate":1391886000,
80+"maxTemp":9,
81+"minTemp":5,
82+"precip_type":"rain",
83+"day":{"wSpeed":45,
84+"wDir":207,
85+"pop":80,
86+"uv":1,
87+"icon":11,
88+"wDirText":"SSW",
89+"phrase":"Showers \/ Wind",
90+"bluntPhrase":"Showers\/Wind",
91+"precip_type":"rain",
92+"snwAccumPhrase":"",
93+"snwAccumPhraseTerse":"",
94+"extQual":"",
95+"weatherCode":"1110"},
96+"night":{"wSpeed":35,
97+"wDir":219,
98+"pop":70,
99+"uv":0,
100+"icon":11,
101+"wDirText":"SW",
102+"phrase":"Light Rain \/ Wind",
103+"bluntPhrase":"Light Rain",
104+"precip_type":"rain",
105+"snwAccumPhrase":"",
106+"snwAccumPhraseTerse":"",
107+"extQual":"",
108+"weatherCode":"1211"}},
109+{"key":"03770000",
110+"class":"forecast",
111+"validDate":1391972400,
112+"maxTemp":9,
113+"minTemp":2,
114+"precip_type":"rain",
115+"day":{"wSpeed":35,
116+"wDir":237,
117+"pop":20,
118+"uv":1,
119+"icon":24,
120+"wDirText":"WSW",
121+"phrase":"Partly Cloudy \/ Wind",
122+"bluntPhrase":"P Cldy\/Wind",
123+"precip_type":"rain",
124+"snwAccumPhrase":"",
125+"snwAccumPhraseTerse":"",
126+"extQual":"",
127+"weatherCode":"3010"},
128+"night":{"wSpeed":16,
129+"wDir":223,
130+"pop":10,
131+"uv":0,
132+"icon":27,
133+"wDirText":"SW",
134+"phrase":"Mostly Cloudy",
135+"bluntPhrase":"M Cloudy",
136+"precip_type":"precip",
137+"snwAccumPhrase":"",
138+"snwAccumPhraseTerse":"",
139+"extQual":"",
140+"weatherCode":"2700"}},
141+{"key":"03770000",
142+"class":"forecast",
143+"validDate":1392058800,
144+"maxTemp":9,
145+"minTemp":2,
146+"precip_type":"rain",
147+"day":{"wSpeed":16,
148+"wDir":230,
149+"pop":20,
150+"uv":1,
151+"icon":30,
152+"wDirText":"SW",
153+"phrase":"AM Clouds \/ PM Sun",
154+"bluntPhrase":"AM Clouds",
155+"precip_type":"rain",
156+"snwAccumPhrase":"",
157+"snwAccumPhraseTerse":"",
158+"extQual":"",
159+"weatherCode":"9003"},
160+"night":{"wSpeed":12,
161+"wDir":228,
162+"pop":70,
163+"uv":0,
164+"icon":11,
165+"wDirText":"SW",
166+"phrase":"Light Rain",
167+"bluntPhrase":"Light Rain",
168+"precip_type":"rain",
169+"snwAccumPhrase":"",
170+"snwAccumPhraseTerse":"",
171+"extQual":"",
172+"weatherCode":"1201"}},
173+{"key":"03770000",
174+"class":"forecast",
175+"validDate":1392145200,
176+"maxTemp":7,
177+"minTemp":2,
178+"precip_type":"rain",
179+"day":{"wSpeed":28,
180+"wDir":209,
181+"pop":70,
182+"uv":1,
183+"icon":11,
184+"wDirText":"SSW",
185+"phrase":"Showers",
186+"bluntPhrase":"Showers",
187+"precip_type":"rain",
188+"snwAccumPhrase":"",
189+"snwAccumPhraseTerse":"",
190+"extQual":"",
191+"weatherCode":"1100"},
192+"night":{"wSpeed":20,
193+"wDir":237,
194+"pop":40,
195+"uv":0,
196+"icon":11,
197+"wDirText":"WSW",
198+"phrase":"Showers",
199+"bluntPhrase":"Showers",
200+"precip_type":"rain",
201+"snwAccumPhrase":"",
202+"snwAccumPhraseTerse":"",
203+"extQual":"",
204+"weatherCode":"1100"}},
205+{"key":"03770000",
206+"class":"forecast",
207+"validDate":1392231600,
208+"maxTemp":7,
209+"minTemp":5,
210+"precip_type":"rain",
211+"day":{"wSpeed":27,
212+"wDir":218,
213+"pop":70,
214+"uv":1,
215+"icon":11,
216+"wDirText":"SW",
217+"phrase":"Light Rain",
218+"bluntPhrase":"Light Rain",
219+"precip_type":"rain",
220+"snwAccumPhrase":"",
221+"snwAccumPhraseTerse":"",
222+"extQual":"",
223+"weatherCode":"1201"},
224+"night":{"wSpeed":22,
225+"wDir":206,
226+"pop":70,
227+"uv":0,
228+"icon":11,
229+"wDirText":"SSW",
230+"phrase":"Showers",
231+"bluntPhrase":"Showers",
232+"precip_type":"rain",
233+"snwAccumPhrase":"",
234+"snwAccumPhraseTerse":"",
235+"extQual":"",
236+"weatherCode":"1100"}},
237+{"key":"03770000",
238+"class":"forecast",
239+"validDate":1392318000,
240+"maxTemp":8,
241+"minTemp":6,
242+"precip_type":"rain",
243+"day":{"wSpeed":30,
244+"wDir":211,
245+"pop":80,
246+"uv":1,
247+"icon":12,
248+"wDirText":"SSW",
249+"phrase":"Rain",
250+"bluntPhrase":"Rain",
251+"precip_type":"rain",
252+"snwAccumPhrase":"",
253+"snwAccumPhraseTerse":"",
254+"extQual":"",
255+"weatherCode":"1200"},
256+"night":{"wSpeed":24,
257+"wDir":211,
258+"pop":80,
259+"uv":0,
260+"icon":11,
261+"wDirText":"SSW",
262+"phrase":"Showers",
263+"bluntPhrase":"Showers",
264+"precip_type":"rain",
265+"snwAccumPhrase":"",
266+"snwAccumPhraseTerse":"",
267+"extQual":"",
268+"weatherCode":"1100"}},
269+{"key":"03770000",
270+"class":"forecast",
271+"validDate":1392404400,
272+"maxTemp":10,
273+"minTemp":5,
274+"precip_type":"rain",
275+"day":{"wSpeed":27,
276+"wDir":206,
277+"pop":40,
278+"uv":1,
279+"icon":39,
280+"wDirText":"SSW",
281+"phrase":"Scattered Showers",
282+"bluntPhrase":"Sct Showers",
283+"precip_type":"rain",
284+"snwAccumPhrase":"",
285+"snwAccumPhraseTerse":"",
286+"extQual":"",
287+"weatherCode":"3900"},
288+"night":{"wSpeed":24,
289+"wDir":206,
290+"pop":20,
291+"uv":0,
292+"icon":27,
293+"wDirText":"SSW",
294+"phrase":"Mostly Cloudy",
295+"bluntPhrase":"M Cloudy",
296+"precip_type":"rain",
297+"snwAccumPhrase":"",
298+"snwAccumPhraseTerse":"",
299+"extQual":"",
300+"weatherCode":"2700"}},
301+{"key":"03770000",
302+"class":"forecast",
303+"validDate":1392490800,
304+"maxTemp":9,
305+"minTemp":4,
306+"precip_type":"rain",
307+"day":{"wSpeed":20,
308+"wDir":202,
309+"pop":20,
310+"uv":1,
311+"icon":30,
312+"wDirText":"SSW",
313+"phrase":"AM Clouds \/ PM Sun",
314+"bluntPhrase":"AM Clouds",
315+"precip_type":"rain",
316+"snwAccumPhrase":"",
317+"snwAccumPhraseTerse":"",
318+"extQual":"",
319+"weatherCode":"9003"},
320+"night":{"wSpeed":16,
321+"wDir":181,
322+"pop":40,
323+"uv":0,
324+"icon":11,
325+"wDirText":"S",
326+"phrase":"Showers",
327+"bluntPhrase":"Showers",
328+"precip_type":"rain",
329+"snwAccumPhrase":"",
330+"snwAccumPhraseTerse":"",
331+"extQual":"",
332+"weatherCode":"1100"}}],
333+"HourlyForecasts":[{"key":"03770000",
334+"class":"hourlyforecast",
335+"dateTime":1391727600,
336+"temp":10,
337+"feelsLike":7,
338+"wSpeed":22,
339+"wDir":186,
340+"pop":80,
341+"uv":0,
342+"dew":7,
343+"icon":11,
344+"wDirText":"S",
345+"wDesc":"Light Rain",
346+"precip_type":"rain"},
347+{"key":"03770000",
348+"class":"hourlyforecast",
349+"dateTime":1391731200,
350+"temp":10,
351+"feelsLike":7,
352+"wSpeed":20,
353+"wDir":177,
354+"pop":80,
355+"uv":0,
356+"dew":7,
357+"icon":11,
358+"wDirText":"S",
359+"wDesc":"Light Rain",
360+"precip_type":"rain"},
361+{"key":"03770000",
362+"class":"hourlyforecast",
363+"dateTime":1391734800,
364+"temp":10,
365+"feelsLike":7,
366+"wSpeed":19,
367+"wDir":170,
368+"pop":80,
369+"uv":0,
370+"dew":7,
371+"icon":11,
372+"wDirText":"S",
373+"wDesc":"Light Rain",
374+"precip_type":"rain"},
375+{"key":"03770000",
376+"class":"hourlyforecast",
377+"dateTime":1391738400,
378+"temp":10,
379+"feelsLike":7,
380+"wSpeed":19,
381+"wDir":169,
382+"pop":80,
383+"uv":0,
384+"dew":7,
385+"icon":11,
386+"wDirText":"S",
387+"wDesc":"Light Rain",
388+"precip_type":"rain"},
389+{"key":"03770000",
390+"class":"hourlyforecast",
391+"dateTime":1391742000,
392+"temp":10,
393+"feelsLike":7,
394+"wSpeed":17,
395+"wDir":174,
396+"pop":90,
397+"uv":0,
398+"dew":7,
399+"icon":11,
400+"wDirText":"S",
401+"wDesc":"Light Rain",
402+"precip_type":"rain"},
403+{"key":"03770000",
404+"class":"hourlyforecast",
405+"dateTime":1391745600,
406+"temp":9,
407+"feelsLike":6,
408+"wSpeed":19,
409+"wDir":201,
410+"pop":90,
411+"uv":0,
412+"dew":7,
413+"icon":11,
414+"wDirText":"SSW",
415+"wDesc":"Light Rain",
416+"precip_type":"rain"},
417+{"key":"03770000",
418+"class":"hourlyforecast",
419+"dateTime":1391749200,
420+"temp":8,
421+"feelsLike":6,
422+"wSpeed":19,
423+"wDir":260,
424+"pop":90,
425+"uv":0,
426+"dew":6,
427+"icon":12,
428+"wDirText":"W",
429+"wDesc":"Rain",
430+"precip_type":"rain"},
431+{"key":"03770000",
432+"class":"hourlyforecast",
433+"dateTime":1391752800,
434+"temp":7,
435+"feelsLike":4,
436+"wSpeed":20,
437+"wDir":286,
438+"pop":90,
439+"uv":0,
440+"dew":6,
441+"icon":12,
442+"wDirText":"WNW",
443+"wDesc":"Rain",
444+"precip_type":"rain"},
445+{"key":"03770000",
446+"class":"hourlyforecast",
447+"dateTime":1391756400,
448+"temp":6,
449+"feelsLike":2,
450+"wSpeed":24,
451+"wDir":290,
452+"pop":90,
453+"uv":0,
454+"dew":5,
455+"icon":12,
456+"wDirText":"WNW",
457+"wDesc":"Rain",
458+"precip_type":"rain"},
459+{"key":"03770000",
460+"class":"hourlyforecast",
461+"dateTime":1391760000,
462+"temp":6,
463+"feelsLike":1,
464+"wSpeed":32,
465+"wDir":287,
466+"pop":80,
467+"uv":0,
468+"dew":3,
469+"icon":12,
470+"wDirText":"WNW",
471+"wDesc":"Rain \/ Wind",
472+"precip_type":"rain"},
473+{"key":"03770000",
474+"class":"hourlyforecast",
475+"dateTime":1391763600,
476+"temp":6,
477+"feelsLike":1,
478+"wSpeed":32,
479+"wDir":281,
480+"pop":80,
481+"uv":0,
482+"dew":3,
483+"icon":12,
484+"wDirText":"W",
485+"wDesc":"Rain \/ Wind",
486+"precip_type":"rain"},
487+{"key":"03770000",
488+"class":"hourlyforecast",
489+"dateTime":1391767200,
490+"temp":6,
491+"feelsLike":2,
492+"wSpeed":32,
493+"wDir":275,
494+"pop":70,
495+"uv":0,
496+"dew":2,
497+"icon":12,
498+"wDirText":"W",
499+"wDesc":"Rain \/ Wind",
500+"precip_type":"rain"},
501+{"key":"03770000",
502+"class":"hourlyforecast",
503+"dateTime":1391770800,
504+"temp":7,
505+"feelsLike":2,
506+"wSpeed":32,
507+"wDir":271,
508+"pop":50,
509+"uv":0,
510+"dew":2,
511+"icon":11,
512+"wDirText":"W",
513+"wDesc":"Showers \/ Wind",
514+"precip_type":"rain"},
515+{"key":"03770000",
516+"class":"hourlyforecast",
517+"dateTime":1391774400,
518+"temp":7,
519+"feelsLike":3,
520+"wSpeed":32,
521+"wDir":267,
522+"pop":40,
523+"uv":1,
524+"dew":2,
525+"icon":11,
526+"wDirText":"W",
527+"wDesc":"Showers \/ Wind",
528+"precip_type":"rain"},
529+{"key":"03770000",
530+"class":"hourlyforecast",
531+"dateTime":1391778000,
532+"temp":8,
533+"feelsLike":4,
534+"wSpeed":32,
535+"wDir":263,
536+"pop":40,
537+"uv":1,
538+"dew":1,
539+"icon":11,
540+"wDirText":"W",
541+"wDesc":"Showers \/ Wind",
542+"precip_type":"rain"},
543+{"key":"03770000",
544+"class":"hourlyforecast",
545+"dateTime":1391781600,
546+"temp":8,
547+"feelsLike":5,
548+"wSpeed":27,
549+"wDir":257,
550+"pop":0,
551+"uv":1,
552+"dew":1,
553+"icon":32,
554+"wDirText":"WSW",
555+"wDesc":"Sunny",
556+"precip_type":"rain"},
557+{"key":"03770000",
558+"class":"hourlyforecast",
559+"dateTime":1391785200,
560+"temp":8,
561+"feelsLike":5,
562+"wSpeed":24,
563+"wDir":247,
564+"pop":0,
565+"uv":0,
566+"dew":0,
567+"icon":32,
568+"wDirText":"WSW",
569+"wDesc":"Sunny",
570+"precip_type":"rain"},
571+{"key":"03770000",
572+"class":"hourlyforecast",
573+"dateTime":1391788800,
574+"temp":8,
575+"feelsLike":5,
576+"wSpeed":22,
577+"wDir":230,
578+"pop":0,
579+"uv":0,
580+"dew":0,
581+"icon":32,
582+"wDirText":"SW",
583+"wDesc":"Sunny",
584+"precip_type":"rain"},
585+{"key":"03770000",
586+"class":"hourlyforecast",
587+"dateTime":1391792400,
588+"temp":7,
589+"feelsLike":4,
590+"wSpeed":19,
591+"wDir":210,
592+"pop":20,
593+"uv":0,
594+"dew":1,
595+"icon":30,
596+"wDirText":"SSW",
597+"wDesc":"Partly Cloudy",
598+"precip_type":"rain"},
599+{"key":"03770000",
600+"class":"hourlyforecast",
601+"dateTime":1391796000,
602+"temp":7,
603+"feelsLike":3,
604+"wSpeed":17,
605+"wDir":195,
606+"pop":20,
607+"uv":0,
608+"dew":2,
609+"icon":29,
610+"wDirText":"SSW",
611+"wDesc":"Partly Cloudy",
612+"precip_type":"rain"},
613+{"key":"03770000",
614+"class":"hourlyforecast",
615+"dateTime":1391799600,
616+"temp":7,
617+"feelsLike":3,
618+"wSpeed":19,
619+"wDir":190,
620+"pop":20,
621+"uv":0,
622+"dew":2,
623+"icon":29,
624+"wDirText":"S",
625+"wDesc":"Partly Cloudy",
626+"precip_type":"rain"},
627+{"key":"03770000",
628+"class":"hourlyforecast",
629+"dateTime":1391803200,
630+"temp":7,
631+"feelsLike":4,
632+"wSpeed":20,
633+"wDir":189,
634+"pop":50,
635+"uv":0,
636+"dew":3,
637+"icon":11,
638+"wDirText":"S",
639+"wDesc":"Light Rain",
640+"precip_type":"rain"},
641+{"key":"03770000",
642+"class":"hourlyforecast",
643+"dateTime":1391806800,
644+"temp":7,
645+"feelsLike":4,
646+"wSpeed":22,
647+"wDir":188,
648+"pop":70,
649+"uv":0,
650+"dew":3,
651+"icon":11,
652+"wDirText":"S",
653+"wDesc":"Light Rain",
654+"precip_type":"rain"},
655+{"key":"03770000",
656+"class":"hourlyforecast",
657+"dateTime":1391810400,
658+"temp":7,
659+"feelsLike":3,
660+"wSpeed":25,
661+"wDir":183,
662+"pop":80,
663+"uv":0,
664+"dew":3,
665+"icon":11,
666+"wDirText":"S",
667+"wDesc":"Light Rain",
668+"precip_type":"rain"}],
669+"HourlyHiradForecasts":[{"key":"T03770000",
670+"class":"hiradForecast",
671+"validDate":1391727600,
672+"temp":10,
673+"feelsLike":6,
674+"wSpeed":22,
675+"wDir":195,
676+"wDirText":"SSW",
677+"pop":0,
678+"precipRate":"0.0",
679+"visibility":14,
680+"uv":0,
681+"uvText":"Low",
682+"dew":7,
683+"snowRate":"0.0",
684+"icon":26,
685+"text":"Cloudy",
686+"severity":1},
687+{"key":"T03770000",
688+"class":"hiradForecast",
689+"validDate":1391728500,
690+"temp":9,
691+"feelsLike":6,
692+"wSpeed":22,
693+"wDir":190,
694+"wDirText":"S",
695+"pop":0,
696+"precipRate":"0.0",
697+"visibility":14,
698+"uv":0,
699+"uvText":"Low",
700+"dew":7,
701+"snowRate":"0.0",
702+"icon":26,
703+"text":"Cloudy",
704+"severity":1},
705+{"key":"T03770000",
706+"class":"hiradForecast",
707+"validDate":1391729400,
708+"temp":10,
709+"feelsLike":6,
710+"wSpeed":22,
711+"wDir":180,
712+"wDirText":"S",
713+"pop":0,
714+"precipRate":"0.0",
715+"visibility":12,
716+"uv":0,
717+"uvText":"Low",
718+"dew":7,
719+"snowRate":"0.0",
720+"icon":26,
721+"text":"Cloudy",
722+"severity":1},
723+{"key":"T03770000",
724+"class":"hiradForecast",
725+"validDate":1391730300,
726+"temp":9,
727+"feelsLike":6,
728+"wSpeed":20,
729+"wDir":185,
730+"wDirText":"S",
731+"pop":45,
732+"precipRate":"0.25399998",
733+"visibility":16,
734+"uv":0,
735+"uvText":"Low",
736+"dew":7,
737+"snowRate":"0.0",
738+"icon":11,
739+"text":"Showers",
740+"severity":1},
741+{"key":"T03770000",
742+"class":"hiradForecast",
743+"validDate":1391731200,
744+"temp":9,
745+"feelsLike":7,
746+"wSpeed":19,
747+"wDir":185,
748+"wDirText":"S",
749+"pop":90,
750+"precipRate":"1.5239998",
751+"visibility":12,
752+"uv":0,
753+"uvText":"Low",
754+"dew":7,
755+"snowRate":"0.0",
756+"icon":11,
757+"text":"Light Rain",
758+"severity":1},
759+{"key":"T03770000",
760+"class":"hiradForecast",
761+"validDate":1391732100,
762+"temp":9,
763+"feelsLike":7,
764+"wSpeed":19,
765+"wDir":160,
766+"wDirText":"SSE",
767+"pop":60,
768+"precipRate":"0.50799996",
769+"visibility":16,
770+"uv":0,
771+"uvText":"Low",
772+"dew":7,
773+"snowRate":"0.0",
774+"icon":11,
775+"text":"Light Rain",
776+"severity":1},
777+{"key":"T03770000",
778+"class":"hiradForecast",
779+"validDate":1391733000,
780+"temp":9,
781+"feelsLike":7,
782+"wSpeed":20,
783+"wDir":165,
784+"wDirText":"SSE",
785+"pop":90,
786+"precipRate":"3.8100002",
787+"visibility":4,
788+"uv":0,
789+"uvText":"Low",
790+"dew":7,
791+"snowRate":"0.0",
792+"icon":11,
793+"text":"Light Rain",
794+"severity":1},
795+{"key":"T03770000",
796+"class":"hiradForecast",
797+"validDate":1391733900,
798+"temp":9,
799+"feelsLike":7,
800+"wSpeed":19,
801+"wDir":165,
802+"wDirText":"SSE",
803+"pop":90,
804+"precipRate":"4.0639997",
805+"visibility":3,
806+"uv":0,
807+"uvText":"Low",
808+"dew":7,
809+"snowRate":"0.0",
810+"icon":12,
811+"text":"Rain",
812+"severity":1},
813+{"key":"T03770000",
814+"class":"hiradForecast",
815+"validDate":1391734800,
816+"temp":9,
817+"feelsLike":7,
818+"wSpeed":17,
819+"wDir":170,
820+"wDirText":"S",
821+"pop":85,
822+"precipRate":"1.27",
823+"visibility":14,
824+"uv":0,
825+"uvText":"Low",
826+"dew":7,
827+"snowRate":"0.0",
828+"icon":11,
829+"text":"Light Rain",
830+"severity":1},
831+{"key":"T03770000",
832+"class":"hiradForecast",
833+"validDate":1391735700,
834+"temp":9,
835+"feelsLike":7,
836+"wSpeed":17,
837+"wDir":165,
838+"wDirText":"SSE",
839+"pop":70,
840+"precipRate":"0.7619999",
841+"visibility":16,
842+"uv":0,
843+"uvText":"Low",
844+"dew":7,
845+"snowRate":"0.0",
846+"icon":11,
847+"text":"Light Rain",
848+"severity":1},
849+{"key":"T03770000",
850+"class":"hiradForecast",
851+"validDate":1391736600,
852+"temp":9,
853+"feelsLike":7,
854+"wSpeed":17,
855+"wDir":155,
856+"wDirText":"SSE",
857+"pop":25,
858+"precipRate":"0.0",
859+"visibility":12,
860+"uv":0,
861+"uvText":"Low",
862+"dew":7,
863+"snowRate":"0.0",
864+"icon":26,
865+"text":"Cloudy",
866+"severity":1},
867+{"key":"T03770000",
868+"class":"hiradForecast",
869+"validDate":1391737500,
870+"temp":9,
871+"feelsLike":7,
872+"wSpeed":19,
873+"wDir":165,
874+"wDirText":"SSE",
875+"pop":5,
876+"precipRate":"0.0",
877+"visibility":14,
878+"uv":0,
879+"uvText":"Low",
880+"dew":7,
881+"snowRate":"0.0",
882+"icon":26,
883+"text":"Cloudy",
884+"severity":1},
885+{"key":"T03770000",
886+"class":"hiradForecast",
887+"validDate":1391738400,
888+"temp":9,
889+"feelsLike":7,
890+"wSpeed":17,
891+"wDir":160,
892+"wDirText":"SSE",
893+"pop":10,
894+"precipRate":"0.0",
895+"visibility":16,
896+"uv":0,
897+"uvText":"Low",
898+"dew":7,
899+"snowRate":"0.0",
900+"icon":26,
901+"text":"Cloudy",
902+"severity":1},
903+{"key":"T03770000",
904+"class":"hiradForecast",
905+"validDate":1391739300,
906+"temp":9,
907+"feelsLike":7,
908+"wSpeed":17,
909+"wDir":175,
910+"wDirText":"S",
911+"pop":0,
912+"precipRate":"0.0",
913+"visibility":16,
914+"uv":0,
915+"uvText":"Low",
916+"dew":7,
917+"snowRate":"0.0",
918+"icon":26,
919+"text":"Cloudy",
920+"severity":1},
921+{"key":"T03770000",
922+"class":"hiradForecast",
923+"validDate":1391740200,
924+"temp":10,
925+"feelsLike":7,
926+"wSpeed":17,
927+"wDir":170,
928+"wDirText":"S",
929+"pop":5,
930+"precipRate":"0.0",
931+"visibility":14,
932+"uv":0,
933+"uvText":"Low",
934+"dew":7,
935+"snowRate":"0.0",
936+"icon":26,
937+"text":"Cloudy",
938+"severity":1},
939+{"key":"T03770000",
940+"class":"hiradForecast",
941+"validDate":1391741100,
942+"temp":10,
943+"feelsLike":7,
944+"wSpeed":16,
945+"wDir":170,
946+"wDirText":"S",
947+"pop":10,
948+"precipRate":"0.0",
949+"visibility":16,
950+"uv":0,
951+"uvText":"Low",
952+"dew":7,
953+"snowRate":"0.0",
954+"icon":26,
955+"text":"Cloudy",
956+"severity":1},
957+{"key":"T03770000",
958+"class":"hiradForecast",
959+"validDate":1391742000,
960+"temp":10,
961+"feelsLike":7,
962+"wSpeed":17,
963+"wDir":185,
964+"wDirText":"S",
965+"pop":50,
966+"precipRate":"0.25399998",
967+"visibility":16,
968+"uv":0,
969+"uvText":"Low",
970+"dew":7,
971+"snowRate":"0.0",
972+"icon":11,
973+"text":"Showers",
974+"severity":1},
975+{"key":"T03770000",
976+"class":"hiradForecast",
977+"validDate":1391742900,
978+"temp":9,
979+"feelsLike":7,
980+"wSpeed":19,
981+"wDir":170,
982+"wDirText":"S",
983+"pop":65,
984+"precipRate":"1.7779999",
985+"visibility":9,
986+"uv":0,
987+"uvText":"Low",
988+"dew":7,
989+"snowRate":"0.0",
990+"icon":11,
991+"text":"Light Rain",
992+"severity":1},
993+{"key":"T03770000",
994+"class":"hiradForecast",
995+"validDate":1391743800,
996+"temp":9,
997+"feelsLike":6,
998+"wSpeed":22,
999+"wDir":170,
1000+"wDirText":"S",
1001+"pop":30,
1002+"precipRate":"0.25399998",
1003+"visibility":16,
1004+"uv":0,
1005+"uvText":"Low",
1006+"dew":7,
1007+"snowRate":"0.0",
1008+"icon":11,
1009+"text":"Few Showers",
1010+"severity":1},
1011+{"key":"T03770000",
1012+"class":"hiradForecast",
1013+"validDate":1391744700,
1014+"temp":9,
1015+"feelsLike":6,
1016+"wSpeed":24,
1017+"wDir":205,
1018+"wDirText":"SSW",
1019+"pop":50,
1020+"precipRate":"0.7619999",
1021+"visibility":16,
1022+"uv":0,
1023+"uvText":"Low",
1024+"dew":7,
1025+"snowRate":"0.0",
1026+"icon":11,
1027+"text":"Showers",
1028+"severity":1},
1029+{"key":"T03770000",
1030+"class":"hiradForecast",
1031+"validDate":1391745600,
1032+"temp":9,
1033+"feelsLike":6,
1034+"wSpeed":20,
1035+"wDir":245,
1036+"wDirText":"WSW",
1037+"pop":50,
1038+"precipRate":"2.0319998",
1039+"visibility":8,
1040+"uv":0,
1041+"uvText":"Low",
1042+"dew":7,
1043+"snowRate":"0.0",
1044+"icon":11,
1045+"text":"Showers",
1046+"severity":1},
1047+{"key":"T03770000",
1048+"class":"hiradForecast",
1049+"validDate":1391746500,
1050+"temp":8,
1051+"feelsLike":6,
1052+"wSpeed":17,
1053+"wDir":200,
1054+"wDirText":"SSW",
1055+"pop":45,
1056+"precipRate":"2.794",
1057+"visibility":12,
1058+"uv":0,
1059+"uvText":"Low",
1060+"dew":7,
1061+"snowRate":"0.0",
1062+"icon":11,
1063+"text":"Showers",
1064+"severity":1},
1065+{"key":"T03770000",
1066+"class":"hiradForecast",
1067+"validDate":1391747400,
1068+"temp":8,
1069+"feelsLike":5,
1070+"wSpeed":20,
1071+"wDir":195,
1072+"wDirText":"SSW",
1073+"pop":45,
1074+"precipRate":"0.50799996",
1075+"visibility":12,
1076+"uv":0,
1077+"uvText":"Low",
1078+"dew":7,
1079+"snowRate":"0.0",
1080+"icon":11,
1081+"text":"Showers",
1082+"severity":1},
1083+{"key":"T03770000",
1084+"class":"hiradForecast",
1085+"validDate":1391748300,
1086+"temp":8,
1087+"feelsLike":5,
1088+"wSpeed":24,
1089+"wDir":235,
1090+"wDirText":"SW",
1091+"pop":35,
1092+"precipRate":"0.25399998",
1093+"visibility":16,
1094+"uv":0,
1095+"uvText":"Low",
1096+"dew":7,
1097+"snowRate":"0.0",
1098+"icon":11,
1099+"text":"Showers",
1100+"severity":1}],
1101+"NarrativeForecasts":[{"key":"03770000",
1102+"class":"narrativeForecast",
1103+"validDate":1391713200,
1104+"dayPart":"Tonight",
1105+"phrase":"Mainly cloudy and rainy. Low 7C. Winds SSW at 10 to 20 mph. Rainfall around 12mm. Localized flooding is possible.",
1106+"uv":0,
1107+"icon":12,
1108+"weatherCode":1200},
1109+{"key":"03770000",
1110+"class":"narrativeForecast",
1111+"validDate":1391756400,
1112+"dayPart":"Tomorrow",
1113+"phrase":"Cloudy with rain in the morning. High 9C. Winds WSW at 20 to 30 mph. Chance of rain 90%.",
1114+"uv":1,
1115+"icon":12,
1116+"weatherCode":6303},
1117+{"key":"03770000",
1118+"class":"narrativeForecast",
1119+"validDate":1391799600,
1120+"dayPart":"Tomorrow night",
1121+"phrase":"Windy with rain at times. Low 7C. Winds S at 25 to 35 mph.",
1122+"uv":0,
1123+"icon":12,
1124+"weatherCode":1210},
1125+{"key":"03770000",
1126+"class":"narrativeForecast",
1127+"validDate":1391842800,
1128+"dayPart":"Saturday",
1129+"phrase":"Windy with showers at times. High 9C. Winds SSW at 25 to 35 mph. Chance of rain 80%. Winds could occasionally gust over 50 mph.",
1130+"uv":1,
1131+"icon":11,
1132+"weatherCode":1110},
1133+{"key":"03770000",
1134+"class":"narrativeForecast",
1135+"validDate":1391886000,
1136+"dayPart":"Saturday",
1137+"phrase":"Windy with showers. Highs 8 to 10C and lows 5 to 7C.",
1138+"uv":1,
1139+"icon":11,
1140+"weatherCode":1110},
1141+{"key":"03770000",
1142+"class":"narrativeForecast",
1143+"validDate":1391929200,
1144+"dayPart":"Sunday",
1145+"phrase":"Windy with times of sun and clouds. Highs 8 to 10C and lows 2 to 4C.",
1146+"uv":1,
1147+"icon":24,
1148+"weatherCode":3010},
1149+{"key":"03770000",
1150+"class":"narrativeForecast",
1151+"validDate":1392015600,
1152+"dayPart":"Monday",
1153+"phrase":"Morning clouds followed by afternoon sun. Highs 8 to 10C and lows 2 to 4C.",
1154+"uv":1,
1155+"icon":30,
1156+"weatherCode":9003},
1157+{"key":"03770000",
1158+"class":"narrativeForecast",
1159+"validDate":1392102000,
1160+"dayPart":"Tuesday",
1161+"phrase":"Chance of showers. Highs 7 to 9C and lows 2 to 4C.",
1162+"uv":1,
1163+"icon":11,
1164+"weatherCode":1100},
1165+{"key":"03770000",
1166+"class":"narrativeForecast",
1167+"validDate":1392188400,
1168+"dayPart":"Wednesday",
1169+"phrase":"Light rain. Highs 7 to 9C and lows 4 to 6C.",
1170+"uv":1,
1171+"icon":11,
1172+"weatherCode":1201},
1173+{"key":"03770000",
1174+"class":"narrativeForecast",
1175+"validDate":1392274800,
1176+"dayPart":"Thursday",
1177+"phrase":"Cloudy with rain. Highs 8 to 10C and lows 6 to 8C.",
1178+"uv":1,
1179+"icon":12,
1180+"weatherCode":1200},
1181+{"key":"03770000",
1182+"class":"narrativeForecast",
1183+"validDate":1392361200,
1184+"dayPart":"Friday",
1185+"phrase":"Chance of showers. Highs 9 to 11C and lows 4 to 6C.",
1186+"uv":1,
1187+"icon":39,
1188+"weatherCode":3900},
1189+{"key":"03770000",
1190+"class":"narrativeForecast",
1191+"validDate":1392447600,
1192+"dayPart":"Saturday",
1193+"phrase":"Clouds giving way to sun . Highs 8 to 10C and lows 3 to 5C.",
1194+"uv":1,
1195+"icon":30,
1196+"weatherCode":9003}],
1197+"SunRiseSet":[{"rise":"1391671863",
1198+"set":"1391705943"},
1199+{"rise":"1391758229",
1200+"set":"1391792489"},
1201+{"rise":"1391844509",
1202+"set":"1391879009"},
1203+{"rise":"1391930789",
1204+"set":"1391965469"},
1205+{"rise":"1392017050",
1206+"set":"1392051970"},
1207+{"rise":"1392103349",
1208+"set":"1392138509"},
1209+{"rise":"1392189689",
1210+"set":"1392225029"},
1211+{"rise":"1392275950",
1212+"set":"1392311530"},
1213+{"rise":"1392362230",
1214+"set":"1392398050"},
1215+{"rise":"1392448529",
1216+"set":"1392484589"}],
1217+"HiradObservation":{"key":"T03770000",
1218+"class":"observation",
1219+"visibility":"16.1",
1220+"date":"1391726700",
1221+"wxIcon":"26",
1222+"temp":8,
1223+"tempMax24":10,
1224+"tempMin24":6,
1225+"precip24Amount":"9.398",
1226+"dewPoint":8,
1227+"pressure":"981.04",
1228+"pressureDescription":"Steady",
1229+"feelsLike":8,
1230+"wSpeed":6,
1231+"wDir":160,
1232+"tend":0,
1233+"uv":0,
1234+"uvText":"Low",
1235+"obsName":"London\/St James",
1236+"wDirText":"SSE",
1237+"text":"Cloudy",
1238+"heatIndex":8,
1239+"windchill":8,
1240+"qualifier":"Locations nearby are reporting rain.",
1241+"qualifier_severity":2,
1242+"blunt_phrase":"Raining at nearby locations.",
1243+"terse_phrase":"Locations nearby are reporting rain.",
1244+"precipHourly":"0.7619999",
1245+"snowIncr":"0.0"},
1246+"StandardObservation":{"key":"EGLC",
1247+"class":"observation",
1248+"visibility":"10.0",
1249+"date":"1391727000",
1250+"wxIcon":"",
1251+"temp":10,
1252+"dewPoint":7,
1253+"pressure":"981.04",
1254+"pressureDescription":"Steady",
1255+"feelsLike":8,
1256+"wSpeed":12,
1257+"wDir":190,
1258+"tend":0,
1259+"uv":0,
1260+"uvText":"Low",
1261+"obsName":"London City Arpt",
1262+"wDirText":"S",
1263+"text":"N\/A",
1264+"heatIndex":10,
1265+"windchill":8,
1266+"qualifier":"",
1267+"blunt_phrase":"",
1268+"terse_phrase":""},
1269+"WeatherAlerts":[{"areaId":"UK013",
1270+"issueOffice":"XTWC",
1271+"etn":"UK013:TRA:T2:2014:02:06",
1272+"phenomenaCode":"TRA",
1273+"significance":"T2",
1274+"class":"alert",
1275+"headline":"Disruption due to rain in effect from 6PM GMT THU until 10:59PM GMT THU",
1276+"description":"Disruption due to rain",
1277+"textId":273997,
1278+"areaName":"London and South East",
1279+"severity":2,
1280+"beginTime":1391709600,
1281+"endTime":1391727540,
1282+"text":"Further spells of heavy rain will affect southern parts of England during the rest of Thursday, clearing from the west during Friday morning. Northwesterly gales may also affect parts of southwest England during the early hours of Friday and exposed coasts of Sussex and Kent later on Friday morning.Another band of rain, heavy at times, accompanied by coastal gales will affect southwest England during Friday evening, moving quickly east across other southern areas early on Saturday, followed by frequent heavy and squally showers. The public should be prepared for disruption due to flooding.This is an update to the warning issued on Wednesday. Source: EUMETNET - MeteoAlarm ",
1283+"hailSize":"",
1284+"hailDesc":""},
1285+{"areaId":"UK013",
1286+"issueOffice":"XTWC",
1287+"etn":"UK013:TRA:T2:2014:02:07",
1288+"phenomenaCode":"TRA",
1289+"significance":"T2",
1290+"class":"alert",
1291+"headline":"Disruption due to rain in effect from 11PM GMT THU until 11PM GMT SAT",
1292+"description":"Disruption due to rain",
1293+"textId":274002,
1294+"areaName":"London and South East",
1295+"severity":2,
1296+"beginTime":1391727600,
1297+"endTime":1391900400,
1298+"text":"Further spells of heavy rain will affect southern parts of England during the rest of Thursday, clearing from the west during Friday morning. Northwesterly gales may also affect parts of southwest England during the early hours of Friday and exposed coasts of Sussex and Kent later on Friday morning.Another band of rain, heavy at times, accompanied by coastal gales will affect southwest England during Friday evening, moving quickly east across other southern areas early on Saturday, followed by frequent heavy and squally showers. The public should be prepared for disruption due to flooding.This is an update to the warning issued on Wednesday. Source: EUMETNET - MeteoAlarm ",
1299+"hailSize":"",
1300+"hailDesc":""}],
1301+"Pollen":[],
1302+"NowHirad":{"key":"T03770000",
1303+"date":1391725800,
1304+"wind":14,
1305+"peakWind":14,
1306+"snowfall":"0.0",
1307+"phrase":"Light rain. Cloudy with temperatures steady near 49F. Winds S at 10 to 15 mph. Chance of rain 85%.",
1308+"severity":1,
1309+"peakSeverity":1,
1310+"vocalCD":"D2:::W08R03:",
1311+"warningType":"",
1312+"icon":"12",
1313+"qpf":"0.1",
1314+"mtrcphrase":"Light rain. Cloudy with temperatures steady near 9C. Winds S at 16 to 24 kmh. Chance of rain 85%.",
1315+"altphrase":"Light rain. Cloudy with temperatures steady near 9C. Winds S at 10 to 15 mph. Chance of rain 85%."},
1316+"HiradPrecipForecasts":[{"key":"T03770000",
1317+"class":"hiRadPrecipForecast",
1318+"eventNo":0,
1319+"fcstTime":1391727341,
1320+"startTime":1391727600,
1321+"endTime":1391730300,
1322+"eventType":0,
1323+"intensity":0,
1324+"severity":0,
1325+"characteristic":0,
1326+"imminence":0,
1327+"confidence":0,
1328+"qpf":"0.0",
1329+"snowQpf":"0.0"},
1330+{"key":"T03770000",
1331+"class":"hiRadPrecipForecast",
1332+"eventNo":1,
1333+"fcstTime":1391727341,
1334+"startTime":1391730300,
1335+"endTime":1391736600,
1336+"eventType":1,
1337+"intensity":2,
1338+"severity":1,
1339+"characteristic":1,
1340+"imminence":2,
1341+"confidence":0,
1342+"qpf":"3.0479996",
1343+"snowQpf":"0.0"},
1344+{"key":"T03770000",
1345+"class":"hiRadPrecipForecast",
1346+"eventNo":2,
1347+"fcstTime":1391727341,
1348+"startTime":1391736600,
1349+"endTime":1391742000,
1350+"eventType":0,
1351+"intensity":0,
1352+"severity":0,
1353+"characteristic":0,
1354+"imminence":0,
1355+"confidence":0,
1356+"qpf":"0.0",
1357+"snowQpf":"0.0"},
1358+{"key":"T03770000",
1359+"class":"hiRadPrecipForecast",
1360+"eventNo":3,
1361+"fcstTime":1391727341,
1362+"startTime":1391742000,
1363+"endTime":1391749200,
1364+"eventType":1,
1365+"intensity":2,
1366+"severity":1,
1367+"characteristic":1,
1368+"imminence":1,
1369+"confidence":0,
1370+"qpf":"2.0319998",
1371+"snowQpf":"0.0"},
1372+{"key":"T03770000",
1373+"class":"hiRadPrecipForecast",
1374+"eventNo":4,
1375+"fcstTime":1391727341,
1376+"startTime":1391749200,
1377+"endTime":1391751000,
1378+"eventType":0,
1379+"intensity":0,
1380+"severity":0,
1381+"characteristic":0,
1382+"imminence":0,
1383+"confidence":0,
1384+"qpf":"0.0",
1385+"snowQpf":"0.0"},
1386+{"key":"T03770000",
1387+"class":"hiRadPrecipForecast",
1388+"eventNo":5,
1389+"fcstTime":1391727341,
1390+"startTime":1391751000,
1391+"endTime":1391751900,
1392+"eventType":1,
1393+"intensity":1,
1394+"severity":1,
1395+"characteristic":1,
1396+"imminence":0,
1397+"confidence":0,
1398+"qpf":"0.0",
1399+"snowQpf":"0.0"},
1400+{"key":"T03770000",
1401+"class":"hiRadPrecipForecast",
1402+"eventNo":6,
1403+"fcstTime":1391727341,
1404+"startTime":1391751900,
1405+"endTime":1391752800,
1406+"eventType":0,
1407+"intensity":0,
1408+"severity":0,
1409+"characteristic":0,
1410+"imminence":0,
1411+"confidence":0,
1412+"qpf":"0.0",
1413+"snowQpf":"0.0"}],
1414+"WhenWillItRain":{"standardPhrase":"Expect occasional rain to begin Friday at 12:45 am GMT",
1415+"bluntPhrase":"Rain beginning Friday at 12:45 am GMT",
1416+"overallType":"1"}}]
1417
1418=== modified file 'src/scopes/tests/test_weatherchannel.py'
1419--- src/scopes/tests/test_weatherchannel.py 2015-05-22 13:33:34 +0000
1420+++ src/scopes/tests/test_weatherchannel.py 2015-10-19 14:12:30 +0000
1421@@ -894,3 +894,12 @@
1422 self.assertEqual(len(resp), 12)
1423 self.assertEqual(resp[0]['sunrise'], None)
1424 self.assertEqual(resp[0]['sunset'], None)
1425+
1426+ def test_forecast_parsing_missing_humidity(self):
1427+ twci = weatherchannel.TWCInterface('urlread', 'foo', FAKE_AUTH, 'en_US', 'desktop')
1428+ forecast = json.loads(get_fixture('weatherchannel-no-humid.json'))
1429+ resp = twci._parse_forecast(forecast[0], 'loc_key')
1430+
1431+ # check we nulled those fields
1432+ self.assertEqual(len(resp), 12)
1433+ self.assertEqual(resp[0]['humidity'], None)
1434
1435=== modified file 'src/scopes/weatherchannel.py'
1436--- src/scopes/weatherchannel.py 2015-05-22 13:33:34 +0000
1437+++ src/scopes/weatherchannel.py 2015-10-19 14:12:30 +0000
1438@@ -292,7 +292,9 @@
1439 wind_sentence = u"%s %s" % (info['wDirText'],
1440 self._speed_converter(info['wSpeed']))
1441 uv = str(info['uv'])
1442- humid = '%i%%' % info['humid']
1443+ humid = info.get('humid')
1444+ if humid is not None:
1445+ humid = '%i%%' % humid
1446 dayparts[part] = {
1447 'max_temp': max_temp,
1448 'min_temp': min_temp,

Subscribers

People subscribed via source and target branches