Files
nginx-unit/test/unit/option.py
Andrei Zeliankou c183bd8749 Tests: get rid of classes in test files.
Class usage came from the unittest framework and it was always redundant
after migration to the pytest.  This commit removes classes from files
containing tests to make them more readable and understandable.
2023-06-14 18:20:09 +01:00

26 lines
557 B
Python

import os
import platform
class Options:
_options = {
'architecture': platform.architecture()[0],
'available': {'modules': {}, 'features': {}},
'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()