Example #1
0
    def tearDown(self):
        BaseTestCase.tearDown(self)

        os.environ = self._var_old_env
        os.chdir(self._var_old_cwd)
        self.__rmtree(self._var_tmpdir)
Example #2
0
    def tearDown(self):
        BaseTestCase.tearDown(self);

        os.environ = self._var_old_env;
        os.chdir(self._var_old_cwd);
        self.__rmtree(self._var_tmpdir);
Example #3
0
    def setUp(self):
        BaseTestCase.setUp(self);

        self._var_tmpdir = tempfile.mkdtemp();
        self._var_old_cwd = os.getcwd();
        os.chdir(self._var_tmpdir);
        self._var_exename = "cyg-apt";
        self._var_old_env = os.environ;
        self._var_arch = "x86";

        # unix tree
        self._dir_mtroot = "{0}/".format(self._var_tmpdir);
        self._dir_tmp = os.path.join(self._dir_mtroot, "tmp");
        self._dir_prefix = os.path.join(self._dir_mtroot, "usr");
        self._dir_bin = os.path.join(self._dir_prefix, "bin");
        self._dir_sysconf = os.path.join(self._dir_mtroot, "etc");
        self._dir_localstate = os.path.join(self._dir_mtroot, "var");
        self._dir_home = os.path.join(self._dir_mtroot, "home");
        self._dir_libexec = os.path.join(self._dir_prefix, "lib");
        self._dir_data = os.path.join(self._dir_prefix, "share");
        self._dir_man = os.path.join(self._dir_data, "man");
        self._dir_info = os.path.join(self._dir_data, "info");
        self._dir_postinstall = os.path.join(self._dir_sysconf, "postinstall");
        self._dir_preremove = os.path.join(self._dir_sysconf, "preremove");
        self._dir_postremove = os.path.join(self._dir_sysconf, "postremove");

        # bulld unix tree
        os.mkdir(self._dir_tmp);
        os.mkdir(self._dir_prefix);
        os.mkdir(self._dir_bin);
        os.mkdir(self._dir_sysconf);
        os.mkdir(self._dir_localstate);
        os.mkdir(self._dir_home);
        os.mkdir(self._dir_libexec);
        os.mkdir(self._dir_data);
        os.mkdir(self._dir_man);
        os.mkdir(self._dir_info);

        self._dir_mirror = self.__getMirrorDir();
        self._var_mirror = "file://{0}".format(self._dir_mirror);
        self._var_mirror_http = "http://cygwin.uib.no/";

        # exe tree
        self._dir_confsetup = os.path.join(self._dir_sysconf, "setup");
        self._dir_user = os.path.join(self._dir_home, "user");
        self._dir_execache = os.path.join(
            self._dir_localstate,
            "cache",
            self._var_exename
        );
        self._dir_exedata = os.path.join(self._dir_data, self._var_exename);

        # build exe tree
        os.mkdir(self._dir_confsetup);
        os.mkdir(self._dir_user);
        os.mkdir(self._dir_exedata);

        # exe files
        self._file_cygwin_sig = os.path.join(
            self._dir_exedata,
            "cygwin.sig"
        );
        self._file_installed_db = os.path.join(
            self._dir_confsetup,
            "installed.db"
        );

        # BC layer for `setup_ini` configuration field
        self._file_setup_ini = os.path.join(
            self._dir_confsetup,
            "setup.ini"
        );

        self._file_setup_rc = os.path.join(
            self._dir_confsetup,
            "setup.rc"
        );
        self._file_user_config = os.path.join(
            self._dir_user,
            ".{0}".format(self._var_exename)
        );

        self._writeSetupRc();

        os.environ['TMP'] = self._dir_tmp;
        os.environ['HOME'] = self._dir_user;

        os.chdir(self._dir_user);

        # build the mirror
        self._var_setupIni = SetupIniProvider(self, self._var_arch);
Example #4
0
 def setUp(self):
     TestCase.setUp(self);
     self.obj = CygAptOb(False);
Example #5
0
 def tearDown(self):
     self.obj._end();
     TestCase.tearDown(self);
Example #6
0
 def tearDown(self):
     self.obj._end()
     TestCase.tearDown(self)
Example #7
0
 def setUp(self):
     TestCase.setUp(self);
     self._var_root = "C:/cygwin";
     self._var_cygwin_p = sys.platform.startswith("cygwin");
Example #8
0
    def setUp(self):
        TestCase.setUp(self);
        self.obj = CygAptArgParser("scriptname");

        self.__originArgv = sys.argv[:];
        sys.argv = sys.argv[:1];
Example #9
0
    def tearDown(self):
        sys.argv = self.__originArgv;

        TestCase.tearDown(self);
Example #10
0
    def tearDown(self):
        sys.argv = self.__originArgv

        TestCase.tearDown(self)
Example #11
0
 def setUp(self):
     TestCase.setUp(self)
     self._var_root = "C:/cygwin"
     self._var_cygwin_p = sys.platform.startswith("cygwin")
Example #12
0
    def setUp(self):
        TestCase.setUp(self)
        self.obj = CygAptArgParser("scriptname")

        self.__originArgv = sys.argv[:]
        sys.argv = sys.argv[:1]
Example #13
0
 def tearDown(self):
     TestCase.tearDown(self)
Example #14
0
 def setUp(self):
     TestCase.setUp(self)
Example #15
0
    def setUp(self):
        BaseTestCase.setUp(self)

        self._var_tmpdir = tempfile.mkdtemp()
        self._var_old_cwd = os.getcwd()
        os.chdir(self._var_tmpdir)
        self._var_exename = "cyg-apt"
        self._var_old_env = os.environ
        self._var_arch = "x86"

        # unix tree
        self._dir_mtroot = "{0}/".format(self._var_tmpdir)
        self._dir_tmp = os.path.join(self._dir_mtroot, "tmp")
        self._dir_prefix = os.path.join(self._dir_mtroot, "usr")
        self._dir_bin = os.path.join(self._dir_prefix, "bin")
        self._dir_sysconf = os.path.join(self._dir_mtroot, "etc")
        self._dir_localstate = os.path.join(self._dir_mtroot, "var")
        self._dir_home = os.path.join(self._dir_mtroot, "home")
        self._dir_libexec = os.path.join(self._dir_prefix, "lib")
        self._dir_data = os.path.join(self._dir_prefix, "share")
        self._dir_man = os.path.join(self._dir_data, "man")
        self._dir_info = os.path.join(self._dir_data, "info")
        self._dir_postinstall = os.path.join(self._dir_sysconf, "postinstall")
        self._dir_preremove = os.path.join(self._dir_sysconf, "preremove")
        self._dir_postremove = os.path.join(self._dir_sysconf, "postremove")

        # bulld unix tree
        os.mkdir(self._dir_tmp)
        os.mkdir(self._dir_prefix)
        os.mkdir(self._dir_bin)
        os.mkdir(self._dir_sysconf)
        os.mkdir(self._dir_localstate)
        os.mkdir(self._dir_home)
        os.mkdir(self._dir_libexec)
        os.mkdir(self._dir_data)
        os.mkdir(self._dir_man)
        os.mkdir(self._dir_info)

        self._dir_mirror = self.__getMirrorDir()
        self._var_mirror = "file://{0}".format(self._dir_mirror)
        self._var_mirror_http = "http://cygwin.uib.no/"

        # exe tree
        self._dir_confsetup = os.path.join(self._dir_sysconf, "setup")
        self._dir_user = os.path.join(self._dir_home, "user")
        self._dir_execache = os.path.join(self._dir_localstate, "cache",
                                          self._var_exename)
        self._dir_exedata = os.path.join(self._dir_data, self._var_exename)

        # build exe tree
        os.mkdir(self._dir_confsetup)
        os.mkdir(self._dir_user)
        os.mkdir(self._dir_exedata)

        # exe files
        self._file_cygwin_sig = os.path.join(self._dir_exedata, "cygwin.sig")
        self._file_installed_db = os.path.join(self._dir_confsetup,
                                               "installed.db")

        # BC layer for `setup_ini` configuration field
        self._file_setup_ini = os.path.join(self._dir_confsetup, "setup.ini")

        self._file_setup_rc = os.path.join(self._dir_confsetup, "setup.rc")
        self._file_user_config = os.path.join(self._dir_user,
                                              ".{0}".format(self._var_exename))

        self._writeSetupRc()

        os.environ['TMP'] = self._dir_tmp
        os.environ['HOME'] = self._dir_user

        os.chdir(self._dir_user)

        # build the mirror
        self._var_setupIni = SetupIniProvider(self, self._var_arch)
Example #16
0
 def setUp(self):
     TestCase.setUp(self)
Example #17
0
 def setUp(self):
     TestCase.setUp(self)
     self.obj = CygAptOb(False)
Example #18
0
 def tearDown(self):
     TestCase.tearDown(self)
Example #19
0
 def setUp(self):
     TestCase.setUp(self)
     self.obj = CygAptURLopener(True)
Example #20
0
 def setUp(self):
     TestCase.setUp(self)
     self.obj = CygAptURLopener(True)