예제 #1
0
	def setUp(self):
		self.host = os.environ.get('MIS_PAPI_HOST')
		if not self.host:
			raise ValueError('MIS_PAPI_HOST not set')
		self.appId = os.environ.get('PAPI_APPID')
		if not self.appId:
			raise ValueError('PAPI_APPID not set')
		self.appKey = os.environ.get('PAPI_APPKEY')
		if not self.appKey:
			raise ValueError('PAPI_APPKEY not set')
		self.papi = PapiClient()
예제 #2
0
class TestPapiClient(unittest.TestCase):
	def setUp(self):
		self.host = os.environ.get('MIS_PAPI_HOST')
		if not self.host:
			raise ValueError('MIS_PAPI_HOST not set')
		self.appId = os.environ.get('PAPI_APPID')
		if not self.appId:
			raise ValueError('PAPI_APPID not set')
		self.appKey = os.environ.get('PAPI_APPKEY')
		if not self.appKey:
			raise ValueError('PAPI_APPKEY not set')
		self.papi = PapiClient()
			
	def test_constructor_with_params(self):
		data = {
			"host": "http://*****:*****@b.c', 'logo':'http://a.com',
			'payment': {
				'method': 'mispay', 'pay_id': '1234', 'live': False
			},
			'booking': {
				'engine': 'local'
			}
		}
		r = self.papi.post_provider(json.dumps(prov))
		print r, type(r)
		self.assertEqual(r['xid'], prov['xid'])
		
	def test_delete_provider_by_id(self):
		r = self.papi.delete_provider_by_id('__test__prov__')
		self.assertTrue(r['status'],'OK')