def _disabled_test_make_request(self): lookup_msg = opensrsapi.XCPMessage( action='LOOKUP', object='DOMAIN', attributes={'domain': 'example.com'}) channel = opensrsapi.XCPChannel(**CONNECTION_OPTIONS) self.assertEqual( '1', channel.make_request(lookup_msg).get_data()['is_success'])
def test_make_request_bad_auth(self): lookup_msg = opensrsapi.XCPMessage( action='LOOKUP', object='DOMAIN', attributes={'domain': 'example.com'}) connection_options = CONNECTION_OPTIONS.copy() connection_options['private_key'] = 'bad_key' channel = opensrsapi.XCPChannel(**connection_options) self.assertRaises(errors.XCPError, channel.make_request, lookup_msg)
def test_make_request_bad_auth(self): lookup_msg = opensrsapi.XCPMessage( action='LOOKUP', object='DOMAIN', attributes={'domain': 'example.com'}) channel = opensrsapi.XCPChannel(host='horizon.opensrs.net', port='55443', username=self.USERNAME, private_key='bad_key') self.assertRaises(errors.XCPError, channel.make_request, lookup_msg)
def _disabled_test_make_request(self): lookup_msg = opensrsapi.XCPMessage( action='LOOKUP', object='DOMAIN', attributes={'domain': 'example.com'}) channel = opensrsapi.XCPChannel(host='horizon.opensrs.net', port='55443', username=self.USERNAME, private_key=self.PRIVATE_KEY) self.assertEqual( '1', channel.make_request(lookup_msg).get_data()['is_success'])
def test_suggest(self): lookup_msg = opensrsapi.XCPMessage( action='NAME_SUGGEST', object='DOMAIN', attributes={ 'searchstring': 'foo', 'tlds': ['.COM', '.ORG', '.NET', '.INFO'], 'maximum': '4', }) channel = opensrsapi.XCPChannel(**CONNECTION_OPTIONS) rsp = channel.make_request(lookup_msg) self.assertEqual('1', rsp.get_data()['is_success']) raise Exception()
def test_suggest(self): lookup_msg = opensrsapi.XCPMessage(action='NAME_SUGGEST', object='DOMAIN', attributes={ 'searchstring': 'foo', 'tlds': ['.COM', '.ORG', '.NET', '.INFO'], 'maximum': '4', }) channel = opensrsapi.XCPChannel(host='horizon.opensrs.net', port='55443', username=self.USERNAME, private_key=self.PRIVATE_KEY) rsp = channel.make_request(lookup_msg) print rsp.get_data() self.assertEqual('1', rsp.get_data()['is_success']) raise Exception()