Exemplo n.º 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')
Exemplo n.º 2
0
	def test_parse_json_field_nonbool(self):
		""" Tests that JSON parsed correctly """
		self.assertEqual(api.parse_json_field('{"hi":"yo"}')['hi'], 'yo')
Exemplo n.º 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')
Exemplo n.º 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'))
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 7
0
 def test_parse_json_field_nonbool(self):
     """ Tests that JSON parsed correctly """
     self.assertEqual(api.parse_json_field('{"hi":"yo"}')['hi'], 'yo')
Exemplo n.º 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'))