Skip to content

Commit d12b83e

Browse files
authored
vdk-csv: uncomment test (#2704)
Addressing: #2677
1 parent 67817f5 commit d12b83e

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

Diff for: projects/vdk-plugins/vdk-csv/tests/functional/test_csv_plugin.py

+27-26
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from unittest import mock
77

88
from click.testing import Result
9+
from vdk.internal.core.errors import ResolvableByActual
910
from vdk.internal.core.errors import UserCodeError
1011
from vdk.plugin.csv import csv_plugin
1112
from vdk.plugin.sqlite import sqlite_plugin
@@ -150,32 +151,32 @@ def test_export_csv_with_already_existing_file(tmpdir):
150151
cli_assert_equal(1, result)
151152

152153

153-
# def test_csv_export_with_nonexistent_table(tmpdir):
154-
# db_dir = str(tmpdir) + "vdk-sqlite.db"
155-
# with mock.patch.dict(
156-
# os.environ,
157-
# {
158-
# "VDK_DB_DEFAULT_TYPE": "SQLITE",
159-
# "VDK_SQLITE_FILE": db_dir,
160-
# },
161-
# ):
162-
# runner = CliEntryBasedTestRunner(sqlite_plugin, csv_plugin)
163-
# drop_table(runner, "test_table")
164-
# result = runner.invoke(
165-
# [
166-
# "export-csv",
167-
# "--query",
168-
# "SELECT * FROM test_table",
169-
# "--file",
170-
# "result3.csv",
171-
# ]
172-
# )
173-
# assert isinstance(result.exception, OperationalError)
174-
# assert hasattr(result.exception, "_vdk_resolvable_actual")
175-
# assert (
176-
# getattr(result.exception, "_vdk_resolvable_actual")
177-
# == ResolvableByActual.PLATFORM
178-
# )
154+
def test_csv_export_with_nonexistent_table(tmpdir):
155+
db_dir = str(tmpdir) + "vdk-sqlite.db"
156+
with mock.patch.dict(
157+
os.environ,
158+
{
159+
"VDK_DB_DEFAULT_TYPE": "SQLITE",
160+
"VDK_SQLITE_FILE": db_dir,
161+
},
162+
):
163+
runner = CliEntryBasedTestRunner(sqlite_plugin, csv_plugin)
164+
drop_table(runner, "test_table")
165+
result = runner.invoke(
166+
[
167+
"export-csv",
168+
"--query",
169+
"SELECT * FROM test_table",
170+
"--file",
171+
"result3.csv",
172+
]
173+
)
174+
assert isinstance(result.exception, OperationalError)
175+
assert hasattr(result.exception, "_vdk_resolvable_actual")
176+
assert (
177+
getattr(result.exception, "_vdk_resolvable_actual")
178+
== ResolvableByActual.PLATFORM
179+
)
179180

180181

181182
def test_csv_export_with_no_data(tmpdir):

0 commit comments

Comments
 (0)