Пример #1
0
 def test_rows_num_less_1(self):
     """Rows_num less than 1"""
     with self.assertRaises(ValueError):
         QueryPaginator(query="dumb", connection=self.conn_file, rows_num=0)
Пример #2
0
 def test_1_create_table(self):
     """CREATE TABLE headers"""
     paginator = QueryPaginator(query=CREATE,
                                connection=TestSQLitePaginatorHeaders.conn)
     self.assertEqual(["Result"], paginator.headers())
Пример #3
0
 def test_all_is_good(self):
     """Query and Connection are both good"""
     paginator = QueryPaginator(query=NW_SELECT, connection=self.conn_file)
     self.assertIsInstance(paginator, QueryPaginator)
Пример #4
0
 def test_badconnection(self):
     """Connection is of unexpected type"""
     with self.assertRaises(ValueError):
         QueryPaginator(query="dumb query", connection="dumb")
Пример #5
0
 def test_noconnection(self):
     """No connection supplied to __init__()"""
     with self.assertRaises(ValueError):
         QueryPaginator(query="dumb query", connection=None)
Пример #6
0
 def test_query_not_str(self):
     """Query is not of type string"""
     with self.assertRaises(ValueError):
         QueryPaginator(query=22, connection=self.conn)
Пример #7
0
 def test_noquery(self):
     """No query supplied to __init__()"""
     with self.assertRaises(ValueError):
         QueryPaginator(query="", connection=self.conn)