Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
80771a36
Commit
80771a36
authored
2 years ago
by
Yoann Schneider
Committed by
Solene Tarride
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add test for format command
parent
c8e21cb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!28
Add test for format command
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_format.py
+36
-0
36 additions, 0 deletions
tests/test_format.py
with
36 additions
and
0 deletions
tests/test_format.py
0 → 100644
+
36
−
0
View file @
80771a36
# -*- coding: utf-8 -*-
from
pathlib
import
Path
import
pytest
from
dan.datasets.format.atr
import
ATRDatasetFormatter
,
remove_spaces
@pytest.mark.parametrize
(
"
text,trimmed
"
,
(
(
"
no_spaces
"
,
"
no_spaces
"
),
(
"
beginning
"
,
"
beginning
"
),
(
"
ending
"
,
"
ending
"
),
(
"
both
"
,
"
both
"
),
(
"
consecutive
"
,
"
consecutive
"
),
(
"
\t
tab
"
,
"
tab
"
),
),
)
def
test_remove_spaces
(
text
,
trimmed
):
assert
remove_spaces
(
text
)
==
trimmed
@pytest.mark.parametrize
(
"
image_format, expected_format
"
,
(
(
"
.png
"
,
"
png
"
),
(
"
png
"
,
"
png
"
),
),
)
def
test_image_format_parsing
(
image_format
,
expected_format
):
formatter
=
ATRDatasetFormatter
(
dataset
=
Path
(
"
my_dataset
"
),
image_format
=
image_format
,
remove_spaces
=
True
)
assert
formatter
.
image_format
==
expected_format
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