コード例 #1
0
 def test_break_on_samecodes(self):
     '''break if you pass in non str/list samecodes'''
     try:
         nws = WeatherAlerts(samecodes=1)
     except Exception:
         pass
     else:
         raise Exception("That shouldn't have worked")
コード例 #2
0
 def test_passing_samecodes(self):
     # Alerts by a Samecode
     testobjs = []
     testobjs.append(WeatherAlerts(samecodes='016027'))
     testobjs.append(WeatherAlerts(samecodes=['016027', '016001', '016073', '016075']))
     samecodes = self.nws.geo.samecodes.keys()  # get list of all known samecodes
     testobjs.append(WeatherAlerts(samecodes=samecodes))  # use them for testing
     for nws in testobjs:
         for alert in nws.alerts:
             x = alert.title
             x = alert.summary
             x = alert.areadesc
             x = alert.event
             x = alert.samecodes
             x = alert.zonecodes
             x = alert.expiration
             x = alert.updated
             x = alert.effective
             x = alert.published
             x = alert.severity
             x = alert.category
             x = alert.urgency
コード例 #3
0
 def test_passing_state(self):
     nws = WeatherAlerts(state='ID')
     for alert in nws.alerts:
         x = alert.title
         x = alert.summary
         x = alert.areadesc
         x = alert.event
         x = alert.samecodes
         x = alert.zonecodes
         x = alert.expiration
         x = alert.updated
         x = alert.effective
         x = alert.published
         x = alert.severity
         x = alert.category
         x = alert.urgency
コード例 #4
0
 def setUp(self):
     self.nws = WeatherAlerts()