def setUp(self):
     self.http_address = "http://fakehost"
     self.ws_address = "ws://fakehost"
     self.http_client = StubJouliaHTTPClient(self.http_address,
                                             auth_token=None)
     self.ws_client = StubJouliaWebsocketClient(self.ws_address,
                                                self.http_client)
Esempio n. 2
0
    def setUp(self):
        self.recipe_instance = 0
        http_client = StubJouliaHTTPClient("fake address")
        self.ws_client = StubJouliaWebsocketClient("fake address", http_client)

        self.gpio = StubGPIO()
        self.pin = OutputPin(self.gpio, 1)
        self.pump = SimplePump(self.ws_client, self.recipe_instance, self.pin)
 def setUp(self):
     self.recipe_instance = 0
     http_client = StubJouliaHTTPClient("fake address")
     self.ws_client = StubJouliaWebsocketClient("fake address", http_client)
     volume = 5.0
     self.temperature_sensor = StubRtdSensor(70.0)
     self.vessel = HeatExchangedVessel(self.ws_client, self.recipe_instance,
                                       volume, self.temperature_sensor)
 def setUp(self):
     self.recipe_instance = 0
     http_client = StubJouliaHTTPClient("fake address")
     self.ws_client = StubJouliaWebsocketClient("fake address", http_client)
     rating = 5500.0
     volume = 5.0
     self.temperature_sensor = StubRtdSensor(70.0)
     self.gpio = StubGPIO()
     self.heating_pin = OutputPin(self.gpio, 0)
     self.vessel = HeatedVessel(self.ws_client, self.recipe_instance,
                                rating, volume, self.temperature_sensor,
                                self.heating_pin)
Esempio n. 5
0
    def setUp(self):
        self.gpio = StubGPIO()
        http_client = StubJouliaHTTPClient("fake address")
        self.ws_client = StubJouliaWebsocketClient("fake address", http_client)
        self.recipe_instance = 0
        self.analog_reader = StubAnalogReader()

        stub_gpio = StubGPIO()

        heating_element_rating = 5500.0
        boil_kettle_volume = 5.0
        boil_kettle_temperature_sensor = StubRtdSensor(70.0)
        boil_kettle_heating_pin = OutputPin(stub_gpio, 0)
        self.boil_kettle = HeatedVessel(self.ws_client, self.recipe_instance,
                                        heating_element_rating,
                                        boil_kettle_volume,
                                        boil_kettle_temperature_sensor,
                                        boil_kettle_heating_pin)

        mash_tun_volume = 5.0
        mash_tun_temperature_sensor = StubRtdSensor(70.0)
        self.mash_tun = HeatExchangedVessel(self.ws_client,
                                            self.recipe_instance,
                                            mash_tun_volume,
                                            mash_tun_temperature_sensor)

        pump_pin = OutputPin(stub_gpio, 1)
        self.main_pump = SimplePump(self.ws_client, self.recipe_instance,
                                    pump_pin)

        recipe_pk = 3
        strike_temperature = 170.0
        mashout_temperature = 170.0
        mashout_time = 15.0 * 60.0
        boil_time = 60.0 * 60.0
        cool_temperature = 70.0
        mash_temperature_profile = MashProfile([])
        volume = 5.0
        pre_boil_volume_gallons = 6.0
        post_boil_volume_gallons = 5.1
        self.recipe = Recipe(recipe_pk, strike_temperature,
                             mashout_temperature, mashout_time, boil_time,
                             cool_temperature, mash_temperature_profile,
                             volume, pre_boil_volume_gallons,
                             post_boil_volume_gallons)

        self.brewhouse = Brewhouse(self.ws_client, self.recipe_instance,
                                   self.boil_kettle, self.mash_tun,
                                   self.main_pump, self.recipe)
    def setUp(self):
        self.http_client = StubJouliaHTTPClient("http://fake-address")
        recipe_instance_pk = 0
        recipe_pk = 0
        self.http_client.recipe_instance = RecipeInstance(
            recipe_instance_pk, recipe_pk)
        with open('testing/brewhouse.json') as brewhouse_file:
            self.http_client.brewhouse = json.load(brewhouse_file)
        strike_temperature = 162.0
        mashout_temperature = 170.0
        mashout_time = 15.0 * 60.0
        boil_time = 60.0 * 60.0
        cool_temperature = 70.0
        mash_temperature_profile = MashProfile([MashStep(15 * 60, 155.0)])
        volume = 5.0
        pre_boil_volume_gallons = 6.0
        post_boil_volume_gallons = 5.1
        self.http_client.recipe = Recipe(recipe_pk, strike_temperature,
                                         mashout_temperature, mashout_time,
                                         boil_time, cool_temperature,
                                         mash_temperature_profile, volume,
                                         pre_boil_volume_gallons,
                                         post_boil_volume_gallons)
        self.ws_client = StubJouliaWebsocketClient("ws://fake-address",
                                                   self.http_client)
        self.start_stop_client = StubAsyncHTTPClient()

        brewhouse_id = 0

        mcp = StubMCP3008(spi=StubSpiDev())
        analog_reference = 3.3  # Volts
        analog_reader = MCP3004AnalogReader(mcp, analog_reference)

        gpio = StubGPIO()

        self.update_manager = StubUpdateManager()

        self.system = SimulatedSystem(self.http_client,
                                      self.ws_client,
                                      self.start_stop_client,
                                      brewhouse_id,
                                      analog_reader,
                                      gpio,
                                      self.update_manager,
                                      clock=StubClock())
Esempio n. 7
0
 def test_create_succeeds(self):  # pylint: disable=no-self-use
     http_client = StubJouliaHTTPClient("fake address")
     StubJouliaWebsocketClient("fake address", http_client)
 def setUp(self):
     http_client = StubJouliaHTTPClient("fake address")
     ws_client = StubJouliaWebsocketClient("fake address", http_client)
     recipe_instance = 0
     self.state_machine = StateMachine(self, ws_client, recipe_instance)
     self.state = State(self.state_machine)