add a way to override config file attributes from the test framework
diff --git a/xos/xos/config.py b/xos/xos/config.py
index e8b8dbc..83d69cb 100644
--- a/xos/xos/config.py
+++ b/xos/xos/config.py
@@ -25,6 +25,11 @@
def str2bool(v):
return v.lower() in ("true", "1")
+# allow the test framework to apply global overrides to the config framework
+override = {}
+def set_override(name, value):
+ override[name] = value
+
class Config:
def __init__(self, config_file=None):
@@ -251,6 +256,8 @@
self.write(filename)
def __getattr__(self, attr):
+ if attr in override:
+ return override[attr]
return getattr(self.config, attr)
if __name__ == '__main__':