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)
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)
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)
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()
def test_2(self): with pytest.raises(FileNotFoundError): PyJobConfig.read_yaml("foobar.yaml")
def test_4(self): parameters = {"platform": "local", "processes": 2} config = PyJobConfig(**parameters) assert config == parameters
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}
def test_2(self): config = PyJobConfig(platform="local", processes=2) assert config == {"platform": "local", "processes": 2}
def test_1(self): config = PyJobConfig() assert config == {}