Ejemplo n.º 1
0
    def test_generate_rpm_va_skip(self):
        # Check that rpm -Va is not called when the --no-rpm-va option is used.
        tool_opts.no_rpm_va = True
        system_info.generate_rpm_va()

        self.assertEqual(utils.run_subprocess.called, 0)
        self.assertFalse(os.path.exists(self.rpmva_output_file))
Ejemplo n.º 2
0
    def test_generate_rpm_va(self):
        # Check that rpm -Va is executed (default) and stored into the specific file.
        system_info.generate_rpm_va()

        self.assertTrue(utils.run_subprocess.called > 0)
        self.assertEqual(utils.run_subprocess.used_args[0][0], "rpm -Va")
        self.assertTrue(os.path.isfile(self.rpmva_output_file))
        self.assertEqual(utils.get_file_content(self.rpmva_output_file), "rpmva\n")
Ejemplo n.º 3
0
 def test_generate_rpm_va(self):
     # TODO: move class from unittest to pytest and use global tool_opts fixture
     # Check that rpm -Va is executed (default) and stored into the specific file.
     tool_opts.no_rpm_va = False
     system_info.generate_rpm_va()
     self.assertTrue(utils.run_subprocess.called > 0)
     self.assertEqual(utils.run_subprocess.used_args[0][0], ["rpm", "-Va"])
     self.assertTrue(os.path.isfile(self.rpmva_output_file))
     self.assertEqual(utils.get_file_content(self.rpmva_output_file), "rpmva\n")