예제 #1
0
    def test_target_from_type(self, monkeypatch, op):
        monkeypatch.setattr(beer_garden.router, "_target_from_type",
                            Mock(return_value="parent"))

        assert _determine_target(op) == "parent"
예제 #2
0
    def test_mismatch(self, monkeypatch, op):
        monkeypatch.setattr(beer_garden.router, "_target_from_type",
                            Mock(return_value="child"))
        op.target_garden_name = "parent"

        assert _determine_target(op) == "child"
예제 #3
0
 def test_neither(self, monkeypatch, op):
     monkeypatch.setattr(beer_garden.router, "_target_from_type",
                         Mock(return_value=None))
     with pytest.raises(UnknownGardenException):
         _determine_target(op)