Exemplo n.º 1
0
 def setUp(self):
     self.testDir = tempfile.mkdtemp()
     self.tempFile = self.create_test_install_file()
     self.invalidTempFile = self.create_invalid_test_install_file()
     self.invalid_extension_file = self.create_invalid_file_extension_install_file(
     )
     Logger.disable_all()
Exemplo n.º 2
0
 def setUp(self):
     self.create_valid_json()
     self.create_valid_multiple_json()
     self.create_valid_no_packages_json()
     self.create_valid_json_no_post_installation_entry()
     self.create_valid_json_with_alternative_names_entry()
     Logger.disable_all()
Exemplo n.º 3
0
 def setUp(self):
     self.create_valid_json()
     self.create_unknown_type_json()
     self.create_file_json()
     self.create_valid_file_append_json()
     self.parser = PostInstallationParser(self.validJSON)
     Logger.disable_all()
Exemplo n.º 4
0
 def setUp(self):
     self.remote_runner_with_remote_verified_source = RemoteRunner(
         Remote(
             "dummy_remote",
             url=
             "https://raw.githubusercontent.com/Parcks/plugins/master/testPlugin.ppl"
         ))
     self.remote_runner_unverified_remote_source = RemoteRunner(
         Remote("dummy_remote", url="http://www.example.com"))
     self.saved_out = sys.stdout
     sys.stdout = open("/dev/null", "w")
     Logger.disable_all()
Exemplo n.º 5
0
 def setUp(self):
     Logger.disable_all()
     self.test_file_creator_path = "/tmp/dummy_path"
     self.file_create = FileCreate("Dummy creator",
                                   self.test_file_creator_path,
                                   "dummy contents")
     self.file_create_as_root = FileCreate("Dummy creator",
                                           self.test_file_creator_path,
                                           "dummy contents", True)
     self.file_create_runner = FileCreateRunner(self.file_create)
     self.file_create_runner_as_root = FileCreateRunner(
         self.file_create_as_root)
Exemplo n.º 6
0
 def setUp(self):
     self.facade = InstallFacade("file.parcks")
     self.facade.distro_name = "debian"
     self.facade.software_catalog = self.create_software_catalog()
     Logger.disable_all()
Exemplo n.º 7
0
 def setUp(self):
     self.controller = InstallationController("file.parcks")
     Logger.disable_all()
Exemplo n.º 8
0
 def setUp(self):
     Logger.disable_all()
     self.runner = RootShellCommandRunner(ShellCommand(["pwd"]))
     self.runner_multiple = RootShellCommandRunner(
         ShellCommand(["pwd", "pwd"]))
Exemplo n.º 9
0
 def setUp(self):
     self.create_valid_shell_json_two()
     self.create_valid_shell_json_one()
     self.create_valid_shell_json_zero()
     Logger.disable_all()
Exemplo n.º 10
0
 def setUp(self):
     self.remote = Remote("Test Plugin")
     Logger.disable_all()
Exemplo n.º 11
0
 def setUp(self):
     self.test_logger = Logger()
Exemplo n.º 12
0
 def setUp(self):
     self.test_file = "/tmp/test_file_permission_reader"
     self.create_file_to_test()
     Logger.disable_all()
Exemplo n.º 13
0
 def tearDown(self):
     Logger.enable()
     sys.stdout.close()
     sys.stdout = self.saved_out
Exemplo n.º 14
0
 def tearDown(self):
     shutil.rmtree(self.testDir)
     Logger.enable()
Exemplo n.º 15
0
 def setUp(self):
     Logger.disable_all()
     self.file_append = FileAppend("Dummy append", "/tmp/test", "appended")
Exemplo n.º 16
0
 def setUp(self):
     self.create_valid_create_file_json()
     self.create_invalid_create_file_json()
     Logger.disable_all()
Exemplo n.º 17
0
 def test_generate_path_calls_make_directory_if_not_exists(
         self, mocked_method):
     logger = Logger()
     path = logger.generate_path()
     self.assertTrue(mocked_method.called)
Exemplo n.º 18
0
 def test_logger_is_singleton(self):
     logger = Logger()
     self.assertEqual(logger, self.test_logger)
Exemplo n.º 19
0
 def setUp(self):
     Logger.disable_all()
     self.create_package_with_post_install()
     self.create_package_without_post_install()
Exemplo n.º 20
0
 def setUp(self):
     Logger.disable_all()
     self.create_package_with_alternatives()
     self.create_installer_without_alternatives()
Exemplo n.º 21
0
 def setUp(self):
     self.create_valid_remote_json()
     self.create_invalid_remote_json()
     self.create_valid_remote_json_with_commands()
     Logger.disable_all()
Exemplo n.º 22
0
 def setUp(self):
     self.create_remote_that_requires_download()
     self.create_remote_that_requires_download_official_repo()
     self.create_invalid_remote()
     Logger.disable_all()
Exemplo n.º 23
0
 def tearDown(self):
     Logger.enable()
     os.remove(self.test_file)
Exemplo n.º 24
0
 def setUp(self):
     Logger.disable_all()
     self.file_create = FileCreate("Dummy creator", "dummy path",
                                   "dummy contents")
Exemplo n.º 25
0
 def setUp(self):
     self.create_facade()
     self.create_json_object()
     self.create_json_array()
     Logger.disable_all()
Exemplo n.º 26
0
 def setUp(self):
     self.remote = Remote("Dummy remote",
                          TestRemoteDownloader.TEST_REMOTE_URL)
     self.remote_downloader = RemoteDownloader(self.remote)
     Logger.disable_all()
Exemplo n.º 27
0
 def setUp(self):
     self.controller = StartupController("file.parcks".split())
     Logger.disable_all()
Exemplo n.º 28
0
 def setUp(self):
     self.create_valid_json()
     self.create_invalid_json()
     self.create_valid_json_with_work_directory()
     Logger.disable_all()
Exemplo n.º 29
0
 def tearDown(self):
     Logger.enable()
Exemplo n.º 30
0
 def _verify_url(self):
     if self.remote_validator.is_external_download_url():
         self._show_warning_and_ask_confirmation_to_continue()
         Logger().logger.warning(
             "Downloading remote from unverified source")