Exemplo n.º 1
0
    def test_template_translation(self, ipaddress, monkeypatch):
        template = "<NOTHING>x<IP>x<HOST>x<host>x<ip>x"
        hostname = "testhost"
        Scenario().add_host(hostname).apply(monkeypatch)
        source = DSProgramSource(hostname, ipaddress, template=template)

        assert source.cmdline == "<NOTHING>x%sx%sx<host>x<ip>x" % (
            ipaddress if ipaddress is not None else "",
            hostname,
        )
Exemplo n.º 2
0
    def test_attribute_defaults(self, ipaddress, monkeypatch):
        template = ""
        hostname = "testhost"
        Scenario().add_host(hostname).apply(monkeypatch)

        source = DSProgramSource(
            hostname,
            ipaddress,
            template=template,
        )
        assert source.hostname == hostname
        assert source.ipaddress == ipaddress
        assert source.cmdline == ""
        assert source.stdin is None
        assert source.description == "Program: "
        assert source.id == "agent"