def test_origin_usage(self): """The machine agent is started with a origin environment variable """ mock_container = self.mocker.patch(LXCContainer) mock_container.is_constructed() self.mocker.result(True) mock_container.is_constructed() self.mocker.result(True) self.mocker.replay() environ = dict(os.environ) environ["JUJU_ORIGIN"] = "lp:~juju/foobar" self.change_environment(**environ) unit_deploy = UnitContainerDeployment(self.unit_name, self.juju_home) container = yield unit_deploy._get_master_template( "local", "127.0.0.1:1", "abc") self.assertEqual(container.origin, "lp:~juju/foobar") self.assertEqual( container.customize_log, os.path.join(self.juju_home, "units", "master-customize.log"))
def test_origin_usage(self): """The machine agent is started with a origin environment variable """ mock_container = self.mocker.patch(LXCContainer) mock_container.is_constructed() self.mocker.result(True) mock_container.is_constructed() self.mocker.result(True) self.mocker.replay() environ = dict(os.environ) environ["JUJU_ORIGIN"] = "lp:~juju/foobar" self.change_environment(**environ) unit_deploy = UnitContainerDeployment( self.unit_name, self.juju_home) container = yield unit_deploy._get_master_template( "local", "127.0.0.1:1", "abc") self.assertEqual(container.origin, "lp:~juju/foobar") self.assertEqual( container.customize_log, os.path.join(self.juju_home, "units", "master-customize.log"))