示例#1
0
def test_set_row_limit(over_default, over_limit, LIMIT):
    cli = PGCli(row_limit=LIMIT)
    stmt = "SELECT * FROM students"
    result = cli._should_show_limit_prompt(stmt, over_default)
    assert result is False

    result = cli._should_show_limit_prompt(stmt, over_limit)
    assert result is True
示例#2
0
def test_default_row_limit(low_count, over_default):
    cli = PGCli()
    stmt = "SELECT * FROM students"
    result = cli._should_show_limit_prompt(stmt, low_count)
    assert result is False

    result = cli._should_show_limit_prompt(stmt, over_default)
    assert result is True
示例#3
0
def test_set_row_limit():
    cli = PGCli(row_limit=LIMIT)
    stmt = "SELECT * FROM students"
    result = cli._should_show_limit_prompt(stmt, over_default)
    assert result is False

    result = cli._should_show_limit_prompt(stmt, over_limit)
    assert result is True
示例#4
0
def test_default_row_limit():
    cli = PGCli()
    stmt = "SELECT * FROM students"
    result = cli._should_show_limit_prompt(stmt, low_count)
    assert result is False

    result = cli._should_show_limit_prompt(stmt, over_default)
    assert result is True
示例#5
0
def test_row_limit_on_non_select(over_default):
    cli = PGCli()
    stmt = "UPDATE students set name='Boby'"
    result = cli._should_show_limit_prompt(stmt, None)
    assert result is False

    cli = PGCli(row_limit=0)
    result = cli._should_show_limit_prompt(stmt, over_default)
    assert result is False
示例#6
0
def test_row_limit_on_non_select():
    cli = PGCli()
    stmt = "UPDATE students set name='Boby'"
    result = cli._should_show_limit_prompt(stmt, None)
    assert result is False

    cli = PGCli(row_limit=0)
    result = cli._should_show_limit_prompt(stmt, over_default)
    assert result is False
示例#7
0
def test_no_limit(over_limit):
    cli = PGCli(row_limit=0)
    stmt = "SELECT * FROM students"

    result = cli._should_show_limit_prompt(stmt, over_limit)
    assert result is False
示例#8
0
def test_no_limit():
    cli = PGCli(row_limit=0)
    stmt = "SELECT * FROM students"

    result = cli._should_show_limit_prompt(stmt, over_limit)
    assert result is False