def test_server(self):
     server_version = '4.0.0'
     full_server_path = os.path.join(self.server_dir, Utils.build_server_dir_name(server_version))
     full_server_zip_path = os.path.join(self.server_dir, Utils.build_server_zip_name(server_version))
     os.makedirs(full_server_path)
     open(full_server_zip_path, 'w+')
     assert os.path.isdir(full_server_path)
     self.uninstaller.server(server_version, self.server_dir)
     assert not os.path.isdir(full_server_path)
 def test_plugin(self):
     short_plugin_name = 'tomcat'
     plugin_version = '3.9.0'
     full_server_path = os.path.join(self.server_dir, Utils.build_server_dir_name(plugin_version))
     plugin_dir = os.path.join(full_server_path, 'plugins')
     full_plugin_path = os.path.join(plugin_dir, Utils.build_plugin_name(plugin_version, short_plugin_name))
     os.makedirs(plugin_dir)
     open(full_plugin_path, 'w+')
     self.uninstaller.plugin(short_plugin_name, plugin_version, self.server_dir)
     assert not os.makedirs(full_plugin_path)
Exemple #3
0
 def test_server(self):
     server_version = '4.0.0'
     full_server_path = os.path.join(
         self.server_dir, Utils.build_server_dir_name(server_version))
     full_server_zip_path = os.path.join(
         self.server_dir, Utils.build_server_zip_name(server_version))
     os.makedirs(full_server_path)
     open(full_server_zip_path, 'w+')
     assert os.path.isdir(full_server_path)
     self.uninstaller.server(server_version, self.server_dir)
     assert not os.path.isdir(full_server_path)
Exemple #4
0
    def plugin(self, name, version, location):
        server_dir = os.path.join(location,
                                  Utils.build_server_dir_name(version))
        plugin_path = "{path}/plugins/{name}".format(
            path=server_dir, name=Utils.build_plugin_name(version, name))

        if os.path.isfile(plugin_path):
            os.remove(plugin_path)
        else:
            print "Plugin {} hasn\'t been removed as it doesn\'t exist".format(
                plugin_path)
Exemple #5
0
 def test_plugin(self):
     short_plugin_name = 'tomcat'
     plugin_version = '3.9.0'
     full_server_path = os.path.join(
         self.server_dir, Utils.build_server_dir_name(plugin_version))
     plugin_dir = os.path.join(full_server_path, 'plugins')
     full_plugin_path = os.path.join(
         plugin_dir,
         Utils.build_plugin_name(plugin_version, short_plugin_name))
     os.makedirs(plugin_dir)
     open(full_plugin_path, 'w+')
     self.uninstaller.plugin(short_plugin_name, plugin_version,
                             self.server_dir)
     assert not os.makedirs(full_plugin_path)
Exemple #6
0
    def server(self, version, location):
        server_dir = os.path.join(location,
                                  Utils.build_server_dir_name(version))
        if os.path.isdir(server_dir):
            shutil.rmtree(server_dir)
        else:
            print "The server {} hasn\'t been removed as it doesn\'t exist".format(
                server_dir)

        zip_path = os.path.join(location, Utils.build_server_zip_name(version))
        if os.path.isfile(zip_path):
            os.remove(zip_path)
        else:
            print "Zip file {} hasn\'t been removed as it doesn\'t exist".format(
                zip_path)