File: test_for.py

package info (click to toggle)
python-sql 1.4.0-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 436 kB
  • sloc: python: 3,956; sh: 9; makefile: 7
file content (16 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This file is part of python-sql.  The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import unittest

from sql import For, Table


class TestFor(unittest.TestCase):
    def test_for(self):
        for_ = For('UPDATE', Table('t1'), Table('t2'), nowait=True)
        self.assertEqual(str(for_), 'FOR UPDATE OF "t1", "t2" NOWAIT')

    def test_for_single_table(self):
        for_ = For('UPDATE')
        for_.tables = Table('t1')
        self.assertEqual(str(for_), 'FOR UPDATE OF "t1"')