def test_query(self): # test with not connected grn = Groonga() self.assertRaises(GroongaError, grn.query, 'a') # test with invalid command grn = Groonga() grn.connect('localhost', 10041) self.assertRaises(GroongaError, grn.query, 'a') # test the query grn = Groonga() grn.connect('localhost', 10041) result = grn.query('table_list') self.assertEqual(result, '''[[["id","UInt32"],["name","ShortText"],\ ["path","ShortText"],["flags","ShortText"],["domain","ShortText"],\ ["range","ShortText"]]]''') # test the query with after the query of invalid command grn = Groonga() grn.connect('localhost', 10041) self.assertRaises(GroongaError, grn.query, 'unknown command') result = grn.query('table_list') self.assertEqual(result, '''[[["id","UInt32"],["name","ShortText"],\ ["path","ShortText"],["flags","ShortText"],["domain","ShortText"],\ ["range","ShortText"]]]''')
def test_query_with_after_invalid_command(self): grn = Groonga() grn.connect() with pytest.raises(GroongaError): grn.query('unknown command') result = grn.query('cache_limit') assert result == '100'
def test_query_with_invalid_command(self): grn = Groonga() grn.connect() with pytest.raises(GroongaError): grn.query('a')
def test_query(self): grn = Groonga() grn.connect() result = grn.query('cache_limit') assert result == '100'
def test_query_with_not_connected(self): grn = Groonga() with pytest.raises(GroongaError): grn.query('a')