Пример #1
0
def test_check_table_disable_empty_column_check(mocker, table):
    mocker.patch.object(db_tables.config, 'ALLOW_NULL_DATASET_COLUMNS', False)
    conn = mock.Mock()
    conn.execute().fetchone.side_effect = [[10], [10], 1, None]
    db_tables._check_table(mock.Mock(), conn, table, table, True)
Пример #2
0
def test_check_table_raises_if_new_table_size_is_smaller(table):
    conn = mock.Mock()
    conn.execute().fetchone.side_effect = [[8], [10]]

    with pytest.raises(db_tables.MissingDataError):
        db_tables._check_table(mock.Mock(), conn, table, table, False)
Пример #3
0
def test_check_table_raises_for_empty_columns(table):
    conn = mock.Mock()
    conn.execute().fetchone.side_effect = [[10], [10], 1, None]

    with pytest.raises(db_tables.UnusedColumnError):
        db_tables._check_table(mock.Mock(), conn, table, table, False)
Пример #4
0
def test_check_table(table):
    conn = mock.Mock()
    conn.execute().fetchone.return_value = [10]

    db_tables._check_table(mock.Mock(), conn, table, table, False)