예제 #1
0
    def test_update_strategy(self, mocker):
        strategy_mock = mocker.Mock()
        strategy_mock.ref = "strategy_ref"
        strategy_mock.epics = {}

        epic = EpicFactory()
        epic.add_strategy(strategy_mock)

        assert strategy_mock.epics[epic.ref] == epic
예제 #2
0
    def test_add_existing_ref(self, mocker):
        epic = EpicFactory()
        epic.strategies = {"MY_REF": "my_strategy"}

        strategy_mock = mocker.Mock()
        strategy_mock.ref = "MY_REF"

        with pytest.raises(EpicException):
            epic.add_strategy(strategy_mock)
예제 #3
0
    def test_add_strategy(self, mocker):
        strategy_mock = mocker.Mock()
        strategy_mock.ref = "strategy_ref"
        strategy_mock.epics = {}

        epic = EpicFactory()
        epic.add_strategy(strategy_mock)

        assert epic.strategies["strategy_ref"] == strategy_mock