コード例 #1
0
ファイル: test_utils.py プロジェクト: juju/juju-gui-charm
 def test_retrieving_address_from_agent_file(self):
     # The API address is correctly retrieved from the machiner agent file.
     with self.agent_file([self.agent_address]) as (unit_dir, _):
         self.assertEqual(self.agent_address, get_api_address(unit_dir))
コード例 #2
0
ファイル: test_utils.py プロジェクト: juju/juju-gui-charm
 def test_multiple_addresses_in_env(self):
     # If multiple API addresses are listed in the environment variable,
     # the first one is returned.
     addresses = "{} foo.example.com:42".format(self.env_address)
     with environ(JUJU_API_ADDRESSES=addresses):
         self.assertEqual(self.env_address, get_api_address())
コード例 #3
0
ファイル: test_utils.py プロジェクト: juju/juju-gui-charm
 def test_both_env_and_agent_file(self):
     # If the API address is included in both the environment and the
     # agent.conf file, the environment variable takes precedence.
     with environ(JUJU_API_ADDRESSES=self.env_address):
         with self.agent_file([self.agent_address]) as (unit_dir, _):
             self.assertEqual(self.env_address, get_api_address(unit_dir))
コード例 #4
0
ファイル: test_utils.py プロジェクト: juju/juju-gui-charm
 def test_multiple_addresses_in_agent_file(self):
     # If multiple API addresses are listed in the agent file, the first
     # one is returned.
     addresses = [self.agent_address, "foo.example.com:42"]
     with self.agent_file(addresses) as (unit_dir, _):
         self.assertEqual(self.agent_address, get_api_address(unit_dir))
コード例 #5
0
ファイル: test_utils.py プロジェクト: juju/juju-gui-charm
 def test_retrieving_address_from_env(self):
     # The API address is correctly retrieved from the environment.
     with environ(JUJU_API_ADDRESSES=self.env_address):
         self.assertEqual(self.env_address, get_api_address())
コード例 #6
0
ファイル: test_utils.py プロジェクト: mitechie/juju-gui-charm
 def test_retrieving_address_from_agent_file(self):
     # The API address is correctly retrieved from the machiner agent file.
     with self.agent_file([self.agent_address]) as (unit_dir, _):
         self.assertEqual(self.agent_address, get_api_address(unit_dir))
コード例 #7
0
ファイル: test_utils.py プロジェクト: mitechie/juju-gui-charm
 def test_both_env_and_agent_file(self):
     # If the API address is included in both the environment and the
     # agent.conf file, the environment variable takes precedence.
     with environ(JUJU_API_ADDRESSES=self.env_address):
         with self.agent_file([self.agent_address]) as (unit_dir, _):
             self.assertEqual(self.env_address, get_api_address(unit_dir))
コード例 #8
0
ファイル: test_utils.py プロジェクト: mitechie/juju-gui-charm
 def test_multiple_addresses_in_env(self):
     # If multiple API addresses are listed in the environment variable,
     # the first one is returned.
     addresses = '{} foo.example.com:42'.format(self.env_address)
     with environ(JUJU_API_ADDRESSES=addresses):
         self.assertEqual(self.env_address, get_api_address())
コード例 #9
0
ファイル: test_utils.py プロジェクト: mitechie/juju-gui-charm
 def test_retrieving_address_from_env(self):
     # The API address is correctly retrieved from the environment.
     with environ(JUJU_API_ADDRESSES=self.env_address):
         self.assertEqual(self.env_address, get_api_address())
コード例 #10
0
ファイル: test_utils.py プロジェクト: mitechie/juju-gui-charm
 def test_multiple_addresses_in_agent_file(self):
     # If multiple API addresses are listed in the agent file, the first
     # one is returned.
     addresses = [self.agent_address, 'foo.example.com:42']
     with self.agent_file(addresses) as (unit_dir, _):
         self.assertEqual(self.agent_address, get_api_address(unit_dir))