Exemplo n.º 1
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)
Exemplo n.º 2
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)
Exemplo n.º 3
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)