示例#1
0
    def test_call_open_trade(self, mocker):
        trade_provider_mock = mocker.Mock()
        trade_mock = mocker.Mock()
        trade_mock.close_from_epic.return_value = "my_trade_close"

        epic = EpicFactory(trade_provider=trade_provider_mock)

        epic.close_trade(trade=trade_mock, test="test")

        assert trade_mock.close_from_epic.call_args_list == [call(test="test")]
示例#2
0
    def test_response(self, mocker):
        trade_provider_mock = mocker.Mock()
        trade_mock = mocker.Mock()
        trade_mock.close_from_epic.return_value = "my_trade_close"

        epic = EpicFactory(trade_provider=trade_provider_mock)

        response = epic.close_trade(trade=trade_mock, test="test")

        assert response == "my_trade_close"