# Path: greenpithumb/clock.py
# class Clock(object):
# class LocalClock(Clock):
# class Timer(object):
#     def wait(self, wait_time_seconds):
#     def now(self):
#     def now(self):
#     def __init__(self, clock, duration):
#     def set_remaining(self, time_remaining):
#     def expired(self):
#     def reset(self):
# 
# Path: greenpithumb/pump.py
# _PUMP_RATE_ML_PER_SEC = 4300.0 / 60.0
# DEFAULT_PUMP_AMOUNT = 200
# class Pump(object):
# class PumpManager(object):
# class PumpScheduler(object):
#     def __init__(self, pi_io, clock, pump_pin):
#     def pump_water(self, amount_ml):
#     def __init__(self, pump, pump_scheduler, moisture_threshold, pump_amount,
#                  timer):
#     def pump_if_needed(self, moisture):
#     def _should_pump(self, moisture):
#     def __init__(self, local_clock, sleep_windows):
#     def is_running_pump_allowed(self):


import datetime
import unittest
import mock
import pytz
from greenpithumb import clock
from greenpithumb import pump
        manager = pump.PumpManager(
            pump=self.mock_pump,
            pump_scheduler=self.mock_pump_scheduler,
            moisture_threshold=300,
            pump_amount=200,
            timer=self.mock_timer)
        self.mock_pump_scheduler.is_running_pump_allowed.return_value = True
        self.mock_timer.expired.return_value = False
        ml_pumped = manager.pump_if_needed(200)
        self.mock_pump.pump_water.assert_called_once_with(200)
        self.mock_timer.reset.assert_called_once()
        self.assertEqual(ml_pumped, 200)

    def test_pump_not_triggered_if_moisture_is_at_threshold(self):
        manager = pump.PumpManager(
            pump=self.mock_pump,
            pump_scheduler=self.mock_pump_scheduler,
            moisture_threshold=300,
            pump_amount=200,
            timer=self.mock_timer)
        self.mock_pump_scheduler.is_running_pump_allowed.return_value = True
        self.mock_timer.expired.return_value = False
        ml_pumped = manager.pump_if_needed(300)
        # Pump should not run if soil moisture is exactly at threshold.
        self.assertFalse(self.mock_pump.pump_water.called)
        self.assertFalse(self.mock_timer.reset.called)
        self.assertEqual(ml_pumped, 0)

    def test_pump_not_triggered_if_moisture_is_high(self):
        manager = pump.PumpManager(

# Path: greenpithumb/clock.py
# class Clock(object):
# class LocalClock(Clock):
# class Timer(object):
#     def wait(self, wait_time_seconds):
#     def now(self):
#     def now(self):
#     def __init__(self, clock, duration):
#     def set_remaining(self, time_remaining):
#     def expired(self):
#     def reset(self):
# 
# Path: greenpithumb/pump.py
# _PUMP_RATE_ML_PER_SEC = 4300.0 / 60.0
# DEFAULT_PUMP_AMOUNT = 200
# class Pump(object):
# class PumpManager(object):
# class PumpScheduler(object):
#     def __init__(self, pi_io, clock, pump_pin):
#     def pump_water(self, amount_ml):
#     def __init__(self, pump, pump_scheduler, moisture_threshold, pump_amount,
#                  timer):
#     def pump_if_needed(self, moisture):
#     def _should_pump(self, moisture):
#     def __init__(self, local_clock, sleep_windows):
#     def is_running_pump_allowed(self):


# Path: tests/test_pump.py
import datetime
import unittest
import mock
import pytz
from greenpithumb import clock
from greenpithumb import pump

        manager = pump.PumpManager(
            pump=self.mock_pump,
            pump_scheduler=self.mock_pump_scheduler,
            moisture_threshold=300,
            pump_amount=200,
            timer=self.mock_timer)
        self.mock_pump_scheduler.is_running_pump_allowed.return_value = True
        self.mock_timer.expired.return_value = False
        ml_pumped = manager.pump_if_needed(200)
        self.mock_pump.pump_water.assert_called_once_with(200)
        self.mock_timer.reset.assert_called_once()
        self.assertEqual(ml_pumped, 200)

    def test_pump_not_triggered_if_moisture_is_at_threshold(self):
        manager = pump.PumpManager(
            pump=self.mock_pump,
            pump_scheduler=self.mock_pump_scheduler,
            moisture_threshold=300,
            pump_amount=200,
            timer=self.mock_timer)
        self.mock_pump_scheduler.is_running_pump_allowed.return_value = True
        self.mock_timer.expired.return_value = False
        ml_pumped = manager.pump_if_needed(300)
        # Pump should not run if soil moisture is exactly at threshold.
        self.assertFalse(self.mock_pump.pump_water.called)
        self.assertFalse(self.mock_timer.reset.called)
        self.assertEqual(ml_pumped, 0)

    def test_pump_not_triggered_if_moisture_is_high(self):
        manager = pump.PumpManager(

            pump=self.mock_pump,