Esempio n. 1
0
    def process_bind_param(self, value, dialect):
        """Marshal the value into its serialized format."""

        if value is not None:
            value = utils.dict_serialize(value)

        return value
Esempio n. 2
0
    def process_bind_param(self, value, dialect):
        """Marshal the value into its serialized format."""

        if value is not None:
            value = utils.dict_serialize(value)

        return value
Esempio n. 3
0
    def test_dict_serialize(self):
        test_data = dict(
            alpha="""alpha/%="'""",
            bravo=54321,
            charlie=None,
            delta=True,
            echo=False,
        )
        exemplar = ("""alpha="alpha%2F%25%3D%22%27"/bravo=54321/"""
                    """charlie=null/delta=true/echo=false""")

        self.assertEqual(utils.dict_serialize(test_data), exemplar)
Esempio n. 4
0
    def test_dict_serialize(self):
        test_data = dict(
            alpha="""alpha/%="'""",
            bravo=54321,
            charlie=None,
            delta=True,
            echo=False,
        )
        exemplar = ("""alpha="alpha%2F%25%3D%22%27"/bravo=54321/"""
                    """charlie=null/delta=true/echo=false""")

        self.assertEqual(utils.dict_serialize(test_data), exemplar)