def test_select_table(self): from pysybase_nix import connect with connect(User=self.user, Password=self.password, Servername=self.servername) as cur: cur.execute('select * from tempdb..testtable') rez = cur.fetchone() self.assertEqual(rez[0:2], (Decimal('10'), '123'), )
def test_select(self): from pysybase_nix import connect with connect(User=self.user, Password=self.password, Servername=self.servername) as cur: cur.execute('select 1') rez = cur.fetchall() self.assertEqual(rez, [(1,)]) cur.execute('select 1') rez = cur.fetchone() self.assertEqual(rez, (1,))
def test_cursor(self): from pysybase_nix import connect, Cursor with connect(User=self.user, Password=self.password, Servername=self.servername) as cur: self.assertIsInstance(cur, Cursor)
def test_connect(self): from pysybase_nix import connect, Connection con = connect(User=self.user, Password=self.password, Servername=self.servername) self.assertIsInstance(con, Connection)