Example #1
0
    def test_cli_full(self):
        """FakeJuju.cli() works correctly when given all args."""
        juju = FakeJuju("/fake-juju", "1.25.6", "/x")
        cli = juju.cli("/y", {"SPAM": "eggs"})

        self.assertEqual(
            cli._exe,
            Executable(
                "/fake-juju", {
                    "SPAM": "eggs",
                    "FAKE_JUJU_DATA_DIR": "/x",
                    "FAKE_JUJU_FAILURES": "/x/juju-failures",
                    "FAKE_JUJU_LOGS_DIR": "/x",
                    "JUJU_HOME": "/y",
                }),
        )
Example #2
0
    def test_cli_minimal(self):
        """FakeJuju.cli() works correctly when given minimal args."""
        juju = FakeJuju("/fake-juju", "1.25.6", "/x")
        cli = juju.cli("/y")

        self.assertEqual(
            cli._exe,
            Executable(
                "/fake-juju",
                dict(
                    os.environ, **{
                        "FAKE_JUJU_DATA_DIR": "/x",
                        "FAKE_JUJU_FAILURES": "/x/juju-failures",
                        "FAKE_JUJU_LOGS_DIR": "/x",
                        "JUJU_HOME": "/y",
                    })),
        )