How to use the confuse.StrSeq function in confuse

To help you get started, we’ve selected a few confuse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beetbox / confuse / test / test_valid.py View on Github external
def test_whitespace_separated_string(self):
        config = _root({'foo': 'bar   baz'})
        valid = config['foo'].get(confuse.StrSeq())
        self.assertEqual(valid, ['bar', 'baz'])
github beetbox / confuse / test / test_valid.py View on Github external
def test_string_tuple(self):
        config = _root({'foo': ('bar', 'baz')})
        valid = config['foo'].get(confuse.StrSeq())
        self.assertEqual(valid, ['bar', 'baz'])
github beetbox / confuse / test / test_valid.py View on Github external
def test_string_list(self):
        config = _root({'foo': ['bar', 'baz']})
        valid = config['foo'].get(confuse.StrSeq())
        self.assertEqual(valid, ['bar', 'baz'])
github beetbox / confuse / test / test_valid.py View on Github external
def test_invalid_type(self):
        config = _root({'foo': 9})
        with self.assertRaises(confuse.ConfigTypeError):
            config['foo'].get(confuse.StrSeq())
github beetbox / confuse / test / test_valid.py View on Github external
def test_invalid_sequence_type(self):
        config = _root({'foo': ['bar', 2126]})
        with self.assertRaises(confuse.ConfigTypeError):
            config['foo'].get(confuse.StrSeq())
github buluba89 / Yatcobot / yatcobot / plugins / actions.py View on Github external
def get_config_template():

        template = {
            'enabled': confuse.TypeTemplate(bool),
            'friends': confuse.StrSeq(),
            'tag_keywords': confuse.StrSeq(),
            'friend_keywords': confuse.StrSeq(),
            'number_keywords': NumberKeywordsTemplate()
        }
        return template
github buluba89 / Yatcobot / yatcobot / plugins / ratings.py View on Github external
def get_config_template():
        template = {
            'enabled': confuse.TypeTemplate(bool),
            'keywords': confuse.StrSeq()
        }
        return template
github buluba89 / Yatcobot / yatcobot / plugins / filters.py View on Github external
def get_config_template():
        # Fixme: minor hack because StrSeq doesnt support default
        strseq = confuse.StrSeq()
        strseq.default = []
        template = {
            'enabled': confuse.TypeTemplate(bool),
            'keywords': strseq,
            'users': strseq,
        }
        return template
github buluba89 / Yatcobot / yatcobot / plugins / actions.py View on Github external
def get_config_template():

        template = {
            'enabled': confuse.TypeTemplate(bool),
            'friends': confuse.StrSeq(),
            'tag_keywords': confuse.StrSeq(),
            'friend_keywords': confuse.StrSeq(),
            'number_keywords': NumberKeywordsTemplate()
        }
        return template