Пример #1
0
def test_get_all_namespaces(monkeypatch):
    monkeypatch.setattr(
        'ideascube.configuration.registry.REGISTRY',
        {'namespace2': {}, 'namespace1': {}})

    namespaces = get_all_namespaces()
    assert list(namespaces) == ['namespace1', 'namespace2']
Пример #2
0
    def report_config(self, _):
        for namespace in get_all_namespaces():
            for key in get_namespaced_configs(namespace):
                value = get_config(namespace, key)
                default = get_default_value(namespace, key)

                print('%s %s: %r (default: %r)' %
                      (namespace, key, value, default))
Пример #3
0
    def report_config(self, _):
        for namespace in get_all_namespaces():
            for key in get_namespaced_configs(namespace):
                value = get_config(namespace, key)
                default = get_default_value(namespace, key)

                print('%s %s: %r (default: %r)' % (
                    namespace, key, value, default))
Пример #4
0
    def list_configs(self, options):
        namespace = options['namespace']

        if namespace is None:
            for namespace in get_all_namespaces():
                print(namespace)

            return

        try:
            for key in get_namespaced_configs(namespace):
                print("%s %s" % (namespace, key))

        except NoSuchConfigurationNamespaceError as e:
            raise CommandError(e)
Пример #5
0
    def list_configs(self, options):
        namespace = options['namespace']

        if namespace is None:
            for namespace in get_all_namespaces():
                print(namespace)

            return

        try:
            for key in get_namespaced_configs(namespace):
                print("%s %s" % (namespace, key))

        except NoSuchConfigurationNamespaceError as e:
            raise CommandError(e)