<commit_before>#!/usr/bin/perl
use strict;
use warnings;
use FindBin '$Bin';
use Test::More 'no_plan';
use Bio::BioVeL::AsynchronousService ':status';

my $names = "$Bin/../Examples/tnrs_names.txt";

BEGIN {
	use_ok('Bio::BioVeL::AsynchronousService::TNRS');
}


SKIP: {
	skip "environment flag TEST_SUPERSMART not set" unless $ENV{'TEST_SUPERSMART'};
	@ARGV = ( '-names' => $names );
	my $tnrs  = Bio::BioVeL::AsynchronousService::TNRS->new;
	my $jobid = $tnrs->jobid;

	while( $tnrs->update ne DONE ) {
		ok( $tnrs->status eq RUNNING, 'still running' );
		sleep 5;
		$tnrs = Bio::BioVeL::AsynchronousService::TNRS->new( 'jobid' => $jobid );
	}

	ok( -e $tnrs->response_location, 'output location exists' );
	my $rb = $tnrs->response_body();
}

# http://biovel.naturalis.nl/biovel?service=TNRS&names=https://raw.githubusercontent.com/naturalis/biovel-nbc/master/Examples/tnrs_names.txt<commit_msg>changed server directory 'biovel' to 'biovel-supersmart' in example call in browser<commit_after>#!/usr/bin/perl
use strict;
use warnings;
use FindBin '$Bin';
use Test::More 'no_plan';
use Bio::BioVeL::AsynchronousService ':status';

my $names = "$Bin/../Examples/tnrs_names.txt";

BEGIN {
	use_ok('Bio::BioVeL::AsynchronousService::TNRS');
}


SKIP: {
	skip "environment flag TEST_SUPERSMART not set" unless $ENV{'TEST_SUPERSMART'};
	@ARGV = ( '-names' => $names );
	my $tnrs  = Bio::BioVeL::AsynchronousService::TNRS->new;
	my $jobid = $tnrs->jobid;

	while( $tnrs->update ne DONE ) {
		ok( $tnrs->status eq RUNNING, 'still running' );
		sleep 5;
		$tnrs = Bio::BioVeL::AsynchronousService::TNRS->new( 'jobid' => $jobid );
	}

	ok( -e $tnrs->response_location, 'output location exists' );
	my $rb = $tnrs->response_body();
}

# call in browser:
# http://biovel.naturalis.nl/biovel-supersmart?service=TNRS&names=https://raw.githubusercontent.com/naturalis/biovel-nbc/master/Examples/tnrs_names.txt
{'fraction_non_alphanumeric': 0.18037974683544303, 'fraction_numerical': 0.0010548523206751054, 'mean_word_length': 5.3872053872053876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5761801', 'n_tokens_mistral': 783, 'n_tokens_neox': 724, 'n_words': 138}