Ejemplo n.º 1
0
    def test_request_bars_with_invalid_params_raises_value_error(
            self, start, stop):
        # Arrange
        actor = MockActor()
        actor.register_base(
            trader_id=self.trader_id,
            msgbus=self.msgbus,
            cache=self.cache,
            clock=self.clock,
            logger=self.logger,
        )

        bar_type = TestStubs.bartype_audusd_1min_bid()

        # Act, Assert
        with pytest.raises(ValueError):
            actor.request_bars(bar_type, start, stop)
Ejemplo n.º 2
0
    def test_request_bars_sends_request_to_data_engine(self):
        # Arrange
        actor = MockActor()
        actor.register_base(
            trader_id=self.trader_id,
            msgbus=self.msgbus,
            cache=self.cache,
            clock=self.clock,
            logger=self.logger,
        )

        bar_type = TestStubs.bartype_audusd_1min_bid()

        # Act
        actor.request_bars(bar_type)

        # Assert
        assert self.data_engine.request_count == 1