Beispiel #1
0
 def test_extract_name_in_path_finds_installed(self, mock_cwd):
     path = os.path.join(conf.get_lib_dir(), "events")
     mock_cwd.return_value = path
     current_agent, current_version = set_current_agent()
     self.assertEqual(AGENT_LONG_VERSION, current_agent)
     self.assertEqual(AGENT_VERSION, str(current_version))
     return
Beispiel #2
0
 def test_extract_name_in_path_finds_installed(self, mock_cwd):
     path = os.path.join(conf.get_lib_dir(), "events")
     mock_cwd.return_value = path
     current_agent, current_version = set_current_agent()
     self.assertEqual(AGENT_LONG_VERSION, current_agent)
     self.assertEqual(AGENT_VERSION, str(current_version))
     return
Beispiel #3
0
 def test_extract_name_finds_latest_agent(self, mock_cwd):
     path = os.path.join(conf.get_lib_dir(),
                         "{0}-{1}".format(AGENT_NAME, "1.2.3"))
     mock_cwd.return_value = path
     agent = os.path.basename(path)
     version = AGENT_NAME_PATTERN.match(agent).group(1)
     current_agent, current_version = set_current_agent()
     self.assertEqual(agent, current_agent)
     self.assertEqual(version, str(current_version))
Beispiel #4
0
 def test_extract_name_finds_latest_agent(self, mock_cwd):
     path = os.path.join(conf.get_lib_dir(), "{0}-{1}".format(
         AGENT_NAME,
         "1.2.3"))
     mock_cwd.return_value = path
     agent = os.path.basename(path)
     version = AGENT_NAME_PATTERN.match(agent).group(1)
     current_agent, current_version = set_current_agent()
     self.assertEqual(agent, current_agent)
     self.assertEqual(version, str(current_version))
     return
Beispiel #5
0
 def test_extract_name_finds_installed(self, mock_cwd):
     current_agent, current_version = set_current_agent()
     self.assertEqual(AGENT_LONG_VERSION, current_agent)
     self.assertEqual(AGENT_VERSION, str(current_version))
     return
Beispiel #6
0
 def test_extract_name_root_finds_installed(self, mock_cwd):
     current_agent, current_version = set_current_agent()
     self.assertEqual(AGENT_LONG_VERSION, current_agent)
     self.assertEqual(AGENT_VERSION, str(current_version))
     return
Beispiel #7
0
 def test_extract_name_root_finds_installed(self, mock_cwd):  # pylint: disable=unused-argument
     current_agent, current_version = set_current_agent()
     self.assertEqual(AGENT_LONG_VERSION, current_agent)
     self.assertEqual(AGENT_VERSION, str(current_version))