Пример #1
0
    def test_flat_value(self):
        tg = TaskGroup("task group 0")
        tg.max_hosts(5).timeout(42)

        obj = tg.to_map()
        assert "task group 0" == tg.get_name()
        assert "task group 0" == obj["name"]
        assert 5 == obj["max_hosts"]
        assert 42 == obj["timeout"]
Пример #2
0
    def test_invalid_max_hosts(self):
        tg = TaskGroup("task group 0")

        with pytest.raises(TypeError):
            tg.max_hosts("hello world")