Ejemplo 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'), )
Ejemplo 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,))
Ejemplo 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)
Ejemplo 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)