コード例 #1
0
    def test_attribute_defaults(self, monkeypatch, ipaddress):
        template = ""
        hostname = "testhost"
        Scenario().add_host(hostname).apply(monkeypatch)
        source = DSProgramDataSource(hostname, ipaddress, template)

        assert source.id() == "agent"
        assert source.name() == ""
        # ProgramDataSource
        assert source._cpu_tracking_id() == "ds"
        assert source.source_cmdline == ""
        assert source.source_stdin is None
        assert source.describe() == "Program: "
コード例 #2
0
    def test_attribute_defaults(self, monkeypatch, ipaddress):
        template = ""
        hostname = "testhost"
        Scenario().add_host(hostname).apply(monkeypatch)
        source = DSProgramDataSource(
            hostname,
            ipaddress,
            configurator=DSProgramConfigurator(
                hostname,
                ipaddress,
                template=template,
            ),
        )

        assert source.id == "agent"
        assert source.name() == ""
        # ProgramDataSource
        assert source._cpu_tracking_id == "ds"
        assert source.configurator.cmdline == ""
        assert source.configurator.stdin is None
        assert source.configurator.description == "Program: "