Example #1
0
 def test_bad_format_string_multiple(self):
     """Multple format spec in string is disallowed"""
     with pytest.raises(exceptions.InvalidFormattedJsonError):
         format_keys(ForceIncludeToken("{a}{b}"), {"fd": "123"})
Example #2
0
 def test_bad_format_string_extra(self):
     """Extra things in format string"""
     with pytest.raises(exceptions.InvalidFormattedJsonError):
         format_keys(ForceIncludeToken("{fd}gg"), {"fd": "123"})
Example #3
0
 def test_bad_format_string_conversion(self):
     """No format string"""
     with pytest.raises(exceptions.InvalidFormattedJsonError):
         format_keys(ForceIncludeToken(""), {"fd": "123"})
Example #4
0
    def test_custom_format(self, item):
        """Can format everything"""
        val = format_keys(ForceIncludeToken("{fd}"), {"fd": item})

        assert val == item