How to use the uritemplate.variable.URIVariable.reserved function in uritemplate

To help you get started, we’ve selected a few uritemplate 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 python-hyper / uritemplate / test_uritemplate.py View on Github external
def test_post_parse_octothorpe(self):
        v = self.v
        v.operator = '#'
        v.post_parse()
        self.assertEqual(v.join_str, ',')
        self.assertEqual(v.safe, variable.URIVariable.reserved)
        self.assertEqual(v.start, '#')
github python-hyper / uritemplate / uritemplate / variable.py View on Github external
only makes sense to do it in a more easily testable way.
        """
        self.safe = ''
        self.start = self.join_str = self.operator
        if self.operator == '+':
            self.start = ''
        if self.operator in ('+', '#', ''):
            self.join_str = ','
        if self.operator == '#':
            self.start = '#'
        if self.operator == '?':
            self.start = '?'
            self.join_str = '&'

        if self.operator in ('+', '#'):
            self.safe = URIVariable.reserved