Example #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
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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
Example #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