Files
nginx-unit/test/unit/option.py
Andrei Zeliankou 31ff94add9 Tests: more fixtures.
Common methods from applications/proto.py converted to the fixtures.
sysctl check moved to the specific file where it is using.
Some options moved to the constructor to have early access.
2023-05-29 16:45:49 +01:00

24 lines
501 B
Python

import os
import platform
class Options:
_options = {
'architecture': platform.architecture()[0],
'is_privileged': os.geteuid() == 0,
'skip_alerts': [],
'skip_sanitizer': False,
'system': platform.system()
}
def __setattr__(self, name, value):
Options._options[name] = value
def __getattr__(self, name):
if name in Options._options:
return Options._options[name]
raise AttributeError
option = Options()