Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cb-util
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Alt
cb-util
Commits
e183f604
Commit
e183f604
authored
2 years ago
by
Christoph Alt
Browse files
Options
Downloads
Patches
Plain Diff
rework of select tests
parent
030a6565
No related branches found
No related tags found
No related merge requests found
Pipeline
#45302
passed
2 years ago
Stage: test
Stage: deploy
Stage: trigger
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_sqlite.py
+12
-7
12 additions, 7 deletions
tests/test_sqlite.py
with
12 additions
and
7 deletions
tests/test_sqlite.py
+
12
−
7
View file @
e183f604
...
@@ -15,16 +15,21 @@ from cbutil.util import time_conversion
...
@@ -15,16 +15,21 @@ from cbutil.util import time_conversion
def
test_select
():
def
test_select
():
assert
select_stmt
().
strip
()
==
"
SELECT *
"
assert
select_stmt
().
strip
()
==
"
SELECT *
"
assert
select_stmt
(
"
test
"
).
strip
()
==
"
SELECT test
"
assert
select_stmt
(
"
test
"
).
strip
()
==
"
SELECT test
"
with
pytest
.
raises
(
ValueError
):
select_stmt
(
""
)
with
pytest
.
raises
(
ValueError
):
select_stmt
(
"
"
)
def
test_from
():
@pytest.mark.parametrize
(
"
select
"
,
[
""
,
"
"
])
assert
from_stmt
(
"
table
"
).
strip
()
==
"
FROM table
"
def
test_invalid_select
(
select
):
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
from_stmt
(
""
)
select_stmt
(
select
)
@pytest.mark.parametrize
(
"
from_
"
,
[
"
table
"
,
"
table
"
,
"
table
"
])
def
test_from_strip
(
from_
):
assert
from_stmt
(
from_
).
strip
()
==
"
FROM table
"
@pytest.mark.parametrize
(
"
from_
"
,
[
""
,
"
"
])
def
test_invalid_from
(
from_
):
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
from_stmt
(
"
"
)
from_stmt
(
"
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment