<s> __author__ = '<STR_LIT>' <EOL> import unittest <EOL> import rdflib <EOL> from rdflib . plugins . sparql . processor import SPARQLResult <EOL> import pandas as pd <EOL> from mock import patch <EOL> from niquery . query import QueryBase , SelectQuery , AskQuery <EOL> class QueryBaseTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . query = QueryBase ( ) <EOL> def test_init ( self ) : <EOL> self . assertIsInstance ( self . query , QueryBase ) <EOL> def test_describe_query ( self ) : <EOL> res = self . query . describe_query ( <NUM_LIT:1> ) <EOL> self . assertGreater ( len ( res ) , <NUM_LIT:1> ) <EOL> def test_execute ( self ) : <EOL> res = self . query . execute ( <NUM_LIT:0> ) <EOL> self . assertIsInstance ( res , SPARQLResult ) <EOL> def test_get_graph ( self ) : <EOL> self . assertIsInstance ( self . query . get_graph ( ) , rdflib . Graph ) <EOL> class SelectQueryTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . query = SelectQuery ( ) <EOL> def test_init ( self ) : <EOL> self . assertIsInstance ( self . query , SelectQuery ) <EOL> self . assertGreater ( len ( self . query . sparql_meta ) , <NUM_LIT:0> ) <EOL> def test_execute_select ( self ) : <EOL> res = self . query . execute_select ( <NUM_LIT:0> ) <EOL> self . assertIsInstance ( res , pd . DataFrame ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
