def test_make_it_so_testing(self): fac = FindACode('client_id','user_id','client_key') fac.testing = True ret = fac._make_it_so('/v2/bogus', {'foo':'bar'}) self.assertEqual(ret['status']['code'],200) self.assertEqual(ret['data']['url'],'/v2/bogus') self.assertEqual(ret['data']['body']['foo'],'bar')
def test_api_status_not_200(self): fac = FindACode('client_id','user_id','client_key') with self.assertRaises(Error): fac._make_it_so('/v2/end-user/user/info',{})
def test_404(self): fac = FindACode('client_id','user_id','client_key') with self.assertRaises(Error): fac._make_it_so('/v2/bogus',{})