summaryrefslogtreecommitdiffhomepage
path: root/test/unit/option.py
blob: 7c66c61931cd42d7f7a7b845d518d9247a9e7f38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import platform


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