Exemplo n.º 1
0
 def setup_method(self, tmpdir, monkeypatch):
     # Other setup
     self.cli = MockCLI()
     monkeypatch.setenv('OMERODIR', str(tmpdir))
     self.cli.dir = tmpdir
     self.cli.register("admin", AdminControl, "TEST")
     self.cli.register("config", PrefsControl, "TEST")
Exemplo n.º 2
0
    def setup_method(self, method):
        # Non-temp directories
        build_dir = path() / "build"
        top_dir = path() / ".." / ".." / ".."
        etc_dir = top_dir / "etc"

        # Necessary fiels
        prefs_file = build_dir / "prefs.class"
        internal_cfg = etc_dir / "internal.cfg"
        master_cfg = etc_dir / "master.cfg"

        # Temp directories
        tmp_dir = create_path(folder=True)
        tmp_etc_dir = tmp_dir / "etc"
        tmp_grid_dir = tmp_etc_dir / "grid"
        tmp_lib_dir = tmp_dir / "lib"
        tmp_var_dir = tmp_dir / "var"

        # Setup tmp dir
        [x.makedirs() for x in (tmp_grid_dir, tmp_lib_dir, tmp_var_dir)]
        prefs_file.copy(tmp_lib_dir)
        master_cfg.copy(tmp_etc_dir)
        internal_cfg.copy(tmp_etc_dir)

        # Other setup
        self.cli = MockCLI()
        self.cli.dir = tmp_dir
        self.cli.register("a", AdminControl, "TEST")
        self.cli.register("config", PrefsControl, "TEST")
Exemplo n.º 3
0
    def setup_method(self, method):
        self.cli = MockCLI()
        self.cli.register("db", DatabaseControl, "TEST")

        dir = path(__file__) / ".." / ".." / ".." / ".." / ".." / ".." /\
            ".." / "dist"  # FIXME: should not be hard-coded
        dir = dir.abspath()
        cfg = dir / "etc" / "omero.properties"
        cfg = cfg.abspath()
        self.cli.dir = dir

        self.data = {}
        for line in cfg.text().split("\n"):
            line = line.strip()
            for x in ("version", "patch"):
                key = "omero.db." + x
                if line.startswith(key):
                    self.data[x] = line[len(key) + 1:]

        self.file = create_path()
Exemplo n.º 4
0
 def setup_method(self, tmpadmindir):
     # Other setup
     self.cli = MockCLI()
     self.cli.dir = tmpadmindir
     self.cli.register("admin", AdminControl, "TEST")
     self.cli.register("config", PrefsControl, "TEST")