Exemple #1
0
def check_weather(self, s):
    """
    weather in *: checks the current weather in any part of the globe.
    -- Examples:
        check weather in Canada
    """
    weatherIn.main(self._jarvis, s)
Exemple #2
0
def check_weather(self, s):
    """
    weather in *: checks the current weather in any part of the globe.
    -- Examples:
        check weather in Canada
    """
    weatherIn.main(self._jarvis, s)
Exemple #3
0
    def test_pinpoint_is_called_if_no_location_is_found(self):
        with patch.object(weather_pinpoint, 'main') as pinpoint_mock:
            weatherIn.main(self, 'weather in NowhereReally')
            self.assertTrue(pinpoint_mock.called)

        with patch.object(weather_pinpoint, 'main') as pinpoint_mock:
            weatherIn.main(self, 'weather')
            self.assertTrue(pinpoint_mock.called)
Exemple #4
0
    def test_pinpoint_is_called_if_no_location_is_found(self):
        with patch.object(weather_pinpoint, 'main') as pinpoint_mock:
            weatherIn.main(self, 'weather in UnknownLocationhjbahbchjba')
            self.assertTrue(pinpoint_mock.called)

        with patch.object(weather_pinpoint, 'main') as pinpoint_mock:
            weatherIn.main(self, 'weather')
            self.assertTrue(pinpoint_mock.called)
    def test_pinpoint_is_called_if_no_location_is_found(self):
        with patch.object(weather_pinpoint, 'main') as pinpoint_mock:
            weatherIn.main(self, 'weather in UnknownLocationhjbahbchjba')
            self.assertTrue(pinpoint_mock.called)

        with patch.object(weather_pinpoint, 'main') as pinpoint_mock:
            weatherIn.main(self, 'weather')
            self.assertTrue(pinpoint_mock.called)
Exemple #6
0
 def do_check(self, s):
     """Checks your system's RAM stats."""
     # if s == "ram":
     if "ram" in s:
         system("free -lm")
     # if s == "weather"
     if "weather" in s:
         weatherIn.main(self, s)
Exemple #7
0
def do_weather(self, s):
    """Get information about today's weather in your current location."""
    self = self._jarvis

    word = s.strip()
    if (len(word) > 1):
        weatherIn.main(self, s)
    else:
        weather_pinpoint.main(self.memory, self, s)
Exemple #8
0
def do_weather(self, s):
    """Get information about today's weather in your current location."""
    self = self._jarvis

    word = s.strip()
    if(len(word) > 1):
        weatherIn.main(self, s)
    else:
        weather_pinpoint.main(self.memory, self, s)
 def do_weather(self, s):
     """Get information about today's weather."""
     try:
         word = s.strip()
         if (len(word) > 1):
             weatherIn.main(self, s)
         else:
             weather_pinpoint.main(self.memory, self, s)
     except ConnectionError:
         print(CONNECTION_ERROR_MSG)
Exemple #10
0
 def do_check(self, s):
     """Checks your system's RAM stats."""
     # if s == "ram":
     if "ram" in s:
         system("free -lm")
     # if s == "time"
     elif "time" in s:
         timeIn.main(self, s)
     elif "forecast" in s:
         forecast.main(self, s)
     # if s == "weather"
     elif "weather" in s:
         weatherIn.main(self, s)
 def do_check(self, s):
     """Checks your system's RAM stats."""
     # if s == "ram":
     if "ram" in s:
         system("free -lm")
     # if s == "time"
     elif "time" in s:
         timeIn.main(self, s)
     elif "forecast" in s:
         forecast.main(self, s)
     # if s == "weather"
     elif "weather" in s:
         try:
             weatherIn.main(self, s)
         except ConnectionError:
             print(CONNECTION_ERROR_MSG)