Exemplo n.º 1
0
 def test_1(self):
     fname = TestPyJobConfigRead.get_config_file()
     config = PyJobConfig.read_yaml(fname)
     assert config["platform"] == "local"
     assert config["processes"] == 1
     assert not config["debug"]
     assert config["cutoff"] == 1.0
     os.unlink(fname)
Exemplo n.º 2
0
 def test_1(self):
     config_w = PyJobConfig(platform="local", processes=2)
     config_w.file = "test_config.yaml"
     config_w.write()
     config_r = PyJobConfig.read_yaml(config_w.file)
     assert config_r == config_w
     os.unlink(config_w.file)
Exemplo n.º 3
0
 def test_3(self):
     fname = TestPyJobConfigRead.get_config_file()
     config = PyJobConfig.read_yaml(fname)
     assert config["platform"] == "local"
     config["platform"] = "sge"
     assert config["platform"] == "sge"
     config.lock()
     with pytest.raises(DictLockedError):
         config["platform"] = "local"
     config.unlock()
     config["platform"] = "local"
     assert config["platform"] == "local"
     os.unlink(fname)
Exemplo n.º 4
0
from pyjob.cexec import cexec
from pyjob.config import PyJobConfig
from pyjob.factory import TaskFactory
from pyjob.script import Script
from pyjob.stopwatch import StopWatch
from pyjob.version import __version__

read_script = Script.read
config = PyJobConfig.from_default()
Exemplo n.º 5
0
 def test_2(self):
     with pytest.raises(FileNotFoundError):
         PyJobConfig.read_yaml("foobar.yaml")
Exemplo n.º 6
0
 def test_4(self):
     parameters = {"platform": "local", "processes": 2}
     config = PyJobConfig(**parameters)
     assert config == parameters
Exemplo n.º 7
0
 def test_3(self):
     config = PyJobConfig(platform="local", processes=2)
     assert config == {"platform": "local", "processes": 2}
     config["platform"] = "sge"
     assert config == {"platform": "sge", "processes": 2}
Exemplo n.º 8
0
 def test_2(self):
     config = PyJobConfig(platform="local", processes=2)
     assert config == {"platform": "local", "processes": 2}
Exemplo n.º 9
0
 def test_1(self):
     config = PyJobConfig()
     assert config == {}