@@ -130,11 +130,13 @@ def test_one_df_query(db):
130130 assert db
131131 bad_query = 'thisisabadquery'
132132 good_query = 'twa'
133+
133134 # test search object
134135 results = db .search_object (bad_query , fmt = 'pandas' )
135136 assert not len (results ) # bad query should return empty table
136137 results = db .search_object (good_query , fmt = 'pandas' )
137138 assert isinstance (results , pd .DataFrame )
139+
138140 # test search string
139141 with pytest .raises (KeyError ):
140142 ref_results : Optional [dict ] = db .search_string (bad_query , fmt = 'pandas' , verbose = False )
@@ -146,21 +148,26 @@ def test_one_df_query(db):
146148 filtered_results : Optional [pd .DataFrame ] = results .merge (ref_sources , on = 'source' , suffixes = (None , 'extra' ))
147149 assert isinstance (filtered_results , pd .DataFrame )
148150 filtered_results .drop (columns = list (filtered_results .filter (regex = 'extra' )), inplace = True )
151+
149152 # test one_df_query
150153 stringed_results = one_df_query (filtered_results )
151154 assert isinstance (stringed_results , str )
155+
152156 # test sql query
153157 with pytest .raises (OperationalError ):
154158 _ = db .sql_query ('notasqlquery' , fmt = 'pandas' )
155159 with pytest .raises (OperationalError ):
156160 _ = db .sql_query ('select * from NotaTable' , fmt = 'pandas' )
157161 with pytest .raises (OperationalError ):
158162 _ = db .sql_query ('select * from Sources where notacolumn == "asdf"' , fmt = 'pandas' )
159- raw_sql_query = db .sql_query ('select * from Sources where source == "Luhman 16"' , fmt = 'pandas' )
163+
164+ # Using a source that returns a single row
165+ raw_sql_query = db .sql_query ('select * from Sources where source == "WISE J104915.57-531906.1"' , fmt = 'pandas' )
160166 assert isinstance (raw_sql_query , pd .DataFrame )
167+
168+ # Testing conversion to a markdown string
161169 stringed_results = one_df_query (raw_sql_query )
162170 assert isinstance (stringed_results , str )
163- return
164171
165172
166173def test_multi_df_query (db ):
0 commit comments