__author__ = 'Nolan Nichols <orcid.org/0000-0003-1099-3328>'

import unittest

import rdflib
import pandas as pd
from mock import patch

from niquery.query import QueryBase, SelectQuery, AskQuery


class QueryBaseTestCase(unittest.TestCase):

    def setUp(self):
        self.query = QueryBase()

    def test_init(self):
        self.assertIsInstance(self.query, QueryBase)

    def test_describe_query(self):
        res = self.query.describe_query(1)
        self.assertGreater(len(res), 1)

    def test_execute(self):
        res = self.query.execute(0)
        self.assertIsNone(res)

    def test_get_graph(self):
        self.assertIsInstance(self.query.get_graph(), rdflib.Graph)


class SelectQueryTestCase(unittest.TestCase):

    def setUp(self):
        self.query = SelectQuery()

    def test_init(self):
        self.assertIsInstance(self.query, SelectQuery)
        self.assertGreater(len(self.query.sparql_meta), 0)

    def test_execute(self):
        self.assertRaises(Exception, self.query.execute, 0)

if __name__ == '__main__':
    unittest.main()

@@ -86,16 +86,73 @@
  rdflib%0A
+from rdflib.plugins.sparql.processor import SPARQLResult%0A
 import p
@@ -635,16 +635,34 @@
 rtIs
-None(res
+Instance(res, SPARQLResult
 )%0A%0A 
@@ -1016,32 +1016,39 @@
 def test_execute
+_select
 (self):%0A        
@@ -1051,58 +1051,90 @@
     
-self.assertRaises(Exception, self.query.execute, 0
+res = self.query.execute_select(0)%0A        self.assertIsInstance(res, pd.DataFrame
 )%0A%0Ai

update tests