def test_parse_json_field(self): """ Tests that neither lists nor dictionaries are left alone """ self.assertEqual(api.parse_json_field('hello'), 'hello')
def test_parse_json_field_nonbool(self): """ Tests that JSON parsed correctly """ self.assertEqual(api.parse_json_field('{"hi":"yo"}')['hi'], 'yo')
def test_parse_json_either(self): """ Tests that either parse can be used interchangeaby """ assert len(api.parse_json_field('[1,2,3,4,5]')) == 5 self.assertEqual(api.parse_json_list_field('{"hi":"yo"}')['hi'], 'yo')
def test_parse_json_field_bool(self): """ Tests that bool 'parsed' correctly """ self.assertFalse(api.parse_json_field('false')) self.assertTrue(api.parse_json_field('true'))