示例#1
0
	def test_parse_json_field(self):
		""" Tests that neither lists nor dictionaries are left alone """
		self.assertEqual(api.parse_json_field('hello'), 'hello')
示例#2
0
	def test_parse_json_field_nonbool(self):
		""" Tests that JSON parsed correctly """
		self.assertEqual(api.parse_json_field('{"hi":"yo"}')['hi'], 'yo')
示例#3
0
	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')
示例#4
0
	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'))
示例#5
0
 def test_parse_json_field(self):
     """ Tests that neither lists nor dictionaries are left alone """
     self.assertEqual(api.parse_json_field('hello'), 'hello')
示例#6
0
 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')
示例#7
0
 def test_parse_json_field_nonbool(self):
     """ Tests that JSON parsed correctly """
     self.assertEqual(api.parse_json_field('{"hi":"yo"}')['hi'], 'yo')
示例#8
0
 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'))