コード例 #1
0
 def __init__(self, app, bro_name=None, identity=None):
     self.app = app
     self.net_name = config_value("network_prefix")
     if self.net_name is None:
         self.net_name = "/rn"  # Fallback if network_prefix is not defined elsewhere
     if bro_name is not None:
         self.bro_name = bro_name
     else:
         self.bro_name = config_value("broker_prefix")
     if identity is not None:
         self.identity = identity
     else:
         self.identity = self.bro_name
コード例 #2
0
async def start_world(ps):
    global args, rns
    await stop_world(ps)  # for sure
    # os.system(f"cd scripts; start-world")
    args = config_value("network")
    if args is None:
        args = ["/rn-1", "/rn-2", "/rn-3"]
    rns = []
    await start(ps)
コード例 #3
0
def test_ternary():
    if _CONFIG_FILE_EXISTS:
        assert config_value("logger", "handlers", "fileHandler") is not None
    else:
        assert True
コード例 #4
0
def test_binary_unknown():
    if _CONFIG_FILE_EXISTS:
        assert config_value("logger", "compressor") is None
    else:
        assert True
コード例 #5
0
def test_binary():
    if _CONFIG_FILE_EXISTS:
        assert config_value("logger", "level") is not None
    else:
        assert True
コード例 #6
0
def test_unary():
    if _CONFIG_FILE_EXISTS:
        assert config_value("network_prefix") == "/rn"
    else:
        assert True
コード例 #7
0
def test_0ary():
    if _CONFIG_FILE_EXISTS:
        assert config_value() is not None
    else:
        assert True
コード例 #8
0
def config(name, default):
    value = config_value(name)
    return value if value else default