예제 #1
0
def test_extract_package_to_dir(test_plugins, file_server):
    # create a plugin tar file and put it in the file server
    plugin_dir_name = 'mock-plugin-with-requirements'
    plugin_tar_name = test_utils.create_plugin_tar(plugin_dir_name,
                                                   file_server.root_path)

    plugin_source_path = resources.get_resource(
        os.path.join('plugins', plugin_dir_name))
    plugin_tar_url = '{0}/{1}'.format(file_server.url, plugin_tar_name)

    extracted_plugin_path = installer.extract_package_to_dir(plugin_tar_url)
    assert test_utils.are_dir_trees_equal(plugin_source_path,
                                          extracted_plugin_path)
예제 #2
0
    def test_extract_package_to_dir(self):

        # create a plugin tar file and put it in the file server
        plugin_dir_name = 'mock-plugin-with-requirements'
        plugin_tar_name = test_utils.create_plugin_tar(
            plugin_dir_name,
            self.file_server_resource_base)

        plugin_source_path = resources.get_resource(os.path.join(
            'plugins', plugin_dir_name))
        plugin_tar_url = '{0}/{1}'.format(self.file_server_url,
                                          plugin_tar_name)

        extracted_plugin_path = installer.extract_package_to_dir(
            plugin_tar_url)
        self.assertTrue(test_utils.are_dir_trees_equal(
            plugin_source_path,
            extracted_plugin_path))