Ejemplo n.º 1
0
#Text
print('Checking text . . . ')
response = alchemyapi.text('text', test_text);
assert(response['status'] == 'ERROR')	#only works for html and url content
response = alchemyapi.text('html', test_html);
assert(response['status'] == 'OK')
response = alchemyapi.text('url', test_url);
assert(response['status'] == 'OK')
print('Text tests complete!')
print('')



#Text Raw
print('Checking raw text . . . ')
response = alchemyapi.text_raw('text', test_text);
assert(response['status'] == 'ERROR')	#only works for html and url content
response = alchemyapi.text_raw('html', test_html);
assert(response['status'] == 'OK')
response = alchemyapi.text_raw('url', test_url);
assert(response['status'] == 'OK')
print('Raw text tests complete!')
print('')



#Author
print('Checking author . . . ')
response = alchemyapi.author('text', test_text);
assert(response['status'] == 'ERROR')	#only works for html and url content
response = alchemyapi.author('html', test_html);
Ejemplo n.º 2
0
print('')

#Text
print('Checking text . . . ')
response = alchemyapi.text('text', test_text)
assert (response['status'] == 'ERROR')  #only works for html and url content
response = alchemyapi.text('html', test_html)
assert (response['status'] == 'OK')
response = alchemyapi.text('url', test_url)
assert (response['status'] == 'OK')
print('Text tests complete!')
print('')

#Text Raw
print('Checking raw text . . . ')
response = alchemyapi.text_raw('text', test_text)
assert (response['status'] == 'ERROR')  #only works for html and url content
response = alchemyapi.text_raw('html', test_html)
assert (response['status'] == 'OK')
response = alchemyapi.text_raw('url', test_url)
assert (response['status'] == 'OK')
print('Raw text tests complete!')
print('')

#Author
print('Checking author . . . ')
response = alchemyapi.author('text', test_text)
assert (response['status'] == 'ERROR')  #only works for html and url content
response = alchemyapi.author('html', test_html)
assert (response['status'] == 'ERROR')  #there's no author in the test HTML
response = alchemyapi.author('url', test_url)