Exemplo n.º 1
0
def test_get_float_value():
    key_val = random_utilities.random_string()
    numeric_val = random_utilities.random_double()
    row = {key_column: key_val, numeric_column: numeric_val}
    table.insert_row(row)
    assert table.get_float_value(key_column, key_val,
                                 numeric_column) == numeric_val
Exemplo n.º 2
0
def test_insert_row_dict_numeric(cursor):
    value = 101
    values = {
        'id': random_utilities.random_string(),
        'numeric_col': value
    }
    assert postgres.insert_row_as_dict(cursor, test_table_name, values) is True
    postgres.remove_row(cursor, test_table_name, 'numeric_col', value)
Exemplo n.º 3
0
def test_update_value():
    key_val = random_utilities.random_string()
    numeric_val = random_utilities.random_double()
    row = {key_column: key_val, numeric_column: numeric_val}
    table.insert_row(row)
    new_val = random_utilities.random_double()
    assert table.update_value(key_column, key_val, numeric_column,
                              new_val) is True
    assert table.get_float_value(key_column, key_val,
                                 numeric_column) == new_val
Exemplo n.º 4
0
def test_ticker_not_found():
    ticker = random_utilities.random_string()
    with pytest.raises(Exception):
        company_profile_table.get_name(ticker)
Exemplo n.º 5
0
def test_random_string_valid():
    random_string = random_utilities.random_string()
    for letter in random_string:
        assert letter in (string.ascii_letters + string.digits)
Exemplo n.º 6
0
def test_random_string():
    assert random_utilities.random_string() is not None
Exemplo n.º 7
0
def test_random_string_length():
    length = 5
    random_string = random_utilities.random_string(length)
    assert len(random_string) == length
Exemplo n.º 8
0
def test_get_value_string():
    key_val = random_utilities.random_string()
    text_val = random_utilities.random_string()
    row = {key_column: key_val, text_column: text_val}
    table.insert_row(row)
    assert table.get_value(key_column, key_val, text_column) == text_val
Exemplo n.º 9
0
def test_delete_row():
    value = random_utilities.random_string()
    row = {key_column: value}
    table.insert_row(row)
    assert table.delete_row(key_column, value) is True
Exemplo n.º 10
0
def test_insert_row():
    row = {key_column: random_utilities.random_string()}
    assert table.insert_row(row) is True