def test_default_decoder_dict_to_frozendict(self): from josepy.json_util import Field obj = Field.default_decoder({'x': 2}) self.assertIsInstance(obj, util.frozendict) self.assertEqual(obj, util.frozendict(x=2))
def test_default_decoder_passthrough(self): mock_value = mock.MagicMock() from josepy.json_util import Field self.assertIs(Field.default_decoder(mock_value), mock_value)
def test_default_decoder_list_to_tuple(self): from josepy.json_util import Field self.assertEqual((1, 2, 3), Field.default_decoder([1, 2, 3]))