Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
MPAI-Private
MPAI-CAE
arp
Tape Irregularity Classifier
Commits
72ba8009
Commit
72ba8009
authored
Jul 06, 2023
by
Matteo
Browse files
update
parent
36a71c97
Pipeline
#33
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
model/model_ROI.h5
0 → 100644
View file @
72ba8009
File added
tests/test_lib.py
0 → 100644
View file @
72ba8009
import
pytest
import
tempfile
import
os
import
uuid
from
mpai_cae_arp.types.irregularity
import
Irregularity
,
Source
,
IrregularityFile
from
tape_irregularity_classifier
import
lib
as
tic
def
test_verify_path
():
with
pytest
.
raises
(
FileNotFoundError
):
working_path
=
""
files_name
=
""
tic
.
verify_path
(
working_path
,
files_name
)
with
tempfile
.
TemporaryDirectory
()
as
working_path
:
files_name
=
"test"
os
.
makedirs
(
working_path
+
"/temp/"
+
files_name
)
assert
tic
.
verify_path
(
working_path
,
files_name
)
==
working_path
+
"/temp/"
+
files_name
def
test_collect_irregularity_images
():
irregularities
=
[]
assert
tic
.
collect_irregularity_images
(
irregularities
)
==
[]
irregularities
=
[
Irregularity
(
irregularity_ID
=
uuid
.
uuid4
(),
source
=
Source
.
VIDEO
,
time_label
=
"00:00:00.000"
,
image_URI
=
"test1.jpg"
,
)]
assert
tic
.
collect_irregularity_images
(
irregularities
)
==
[]
assert
irregularities
==
[]
def
test_get_irregularity_file
():
with
pytest
.
raises
(
FileNotFoundError
):
tic
.
get_irregularity_file
(
""
)
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment