Esempio n. 1
0
    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'), )
Esempio n. 2
0
    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,))
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)