def test_irrigate_zone(self): mock_response("01", pageNumber=0, commandEcho=6) mock_response("BF", pageNumber=0, activeStations=0b10000000000000000000000000000) rainbird = RainbirdController(MOCKED_RAINBIRD_URL, MOCKED_PASSWORD) self.assertEqual(True, rainbird.irrigate_zone(5, 30))
def test_not_acknowledge_response(self): with self.assertRaises(Exception): mock_response("00", commandEcho=17, NAKCode=28) rainbird = RainbirdController(MOCKED_RAINBIRD_URL, MOCKED_PASSWORD) self.assertEqual(False, rainbird.irrigate_zone(1, 30))