示例#1
0
 def test_mold_weather4(self):
     result = mold_weather('partly cloudy')
     assert result == {
         'type': 'cloud',
         'degree': 'light',
         'probability': 'high',
         'measure': 'N/A',
         'snow_chance': False
     }
示例#2
0
 def test_mold_weather2(self):
     result = mold_weather({'modifiers': ['possible'], 'noun': 'rain'})
     assert result == {
         'type': 'rain',
         'degree': 'moderate',
         'probability': 'medium',
         'measure': 'UNKNOWN',
         'snow_chance': False
     }
示例#3
0
 def test_mold_weather3(self):
     result = mold_weather('clear')
     assert result == {
         'type': 'clear',
         'degree': 'N/A',
         'probability': 'high',
         'measure': 'N/A',
         'snow_chance': False
     }
示例#4
0
 def test_mold_weather1(self):
     result = mold_weather({'modifiers': ['heavy'], 'noun': 'rain'})
     assert result == {
         'type': 'rain',
         'degree': 'heavy',
         'probability': 'high',
         'measure': 'UNKNOWN',
         'snow_chance': False
     }
示例#5
0
 def test_mold_weather5(self):
     result = mold_weather({
         'modifiers': ['possible', 'light'],
         'noun': 'flurries',
         'parens': {
             'snow_chance': True,
             'measure': {
                 'unit': 'cm.',
                 'min': 4,
                 'max': 6
             }
         }
     })
     assert result == {
         'type': 'snow',
         'degree': 'extra-light',
         'probability': 'medium',
         'measure': {
             'unit': 'cm.',
             'min': 4,
             'max': 6
         },
         'snow_chance': True
     }