File: test_keywords.py

package info (click to toggle)
sqlparse 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 720 kB
  • sloc: python: 5,310; sql: 167; makefile: 107; sh: 14
file content (13 lines) | stat: -rw-r--r-- 447 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
import pytest

from sqlparse import tokens
from sqlparse.lexer import Lexer


class TestSQLREGEX:
    @pytest.mark.parametrize('number', ['1.0', '-1.0',
                                        '1.', '-1.',
                                        '.1', '-.1'])
    def test_float_numbers(self, number):
        ttype = next(tt for action, tt in Lexer.get_default_instance()._SQL_REGEX if action(number))
        assert tokens.Number.Float == ttype