Пример #1
0
 def test_data4(self, db_cur, queries_file, caplog):
     caplog.set_level(logging.DEBUG)
     sql = Queries(queries_file)
     kwdata = {'countires': ['United States'], 'extra_name': 'BEN'}
     output = sql.CUSTOMERS_OR_STAFF_IN_COUNTRY(db_cur, kwdata)
     assert len(output) == 37
     assert "'countires': ['United States']" in caplog.text
Пример #2
0
 def test_data4_1(self, db_cur, queries_file):
     sql = Queries(queries_file)
     kwdata = {
         'countires': ['United States'],
         'extra_name': 'BEN',
         'unmatched_arg_trigger': True
     }
     output = sql.CUSTOMERS_OR_STAFF_IN_COUNTRY(db_cur, kwdata)
     assert len(output) == 37
Пример #3
0
 def test_data5_1(self, db_cur, queries_file):
     exc_msg = r'^Named argument supplied which does not match a SQL clause: .*'
     with pytest.raises(SQLArgumentException, match=exc_msg):
         sql = Queries(queries_file, strict_parse=True)
         kwdata = {
             'countires': ['United States'],
             'extra_name': 'BEN',
             'extra_param': 'I should not be here'
         }
         sql.CUSTOMERS_OR_STAFF_IN_COUNTRY(db_cur, kwdata, n=1)
Пример #4
0
 def test_data10(self, db_cur, queries_file):
     with pytest.raises(SQLpyException):
         sql = Queries(queries_file)
         kwdata = (['United States'], 'BEN')
         output = sql.CUSTOMERS_OR_STAFF_IN_COUNTRY(db_cur, kwdata)
         assert len(output) == 37
Пример #5
0
 def test_data5_2(self, db_cur, queries_file):
     sql = Queries(queries_file)
     kwdata = {'countires': ['United States'], 'extra_name': 'BEN'}
     output = sql.CUSTOMERS_OR_STAFF_IN_COUNTRY(db_cur, kwdata, n=3)
     assert len(output) == 3