Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.video
Merge requests
!23
Fix the tests
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Closed
Fix the tests
fixes
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Closed
Fix the tests
Amir MOHAMMADI
requested to merge
fixes
into
master
Nov 9, 2017
Overview
0
Commits
1
Pipelines
1
Changes
1
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
181da91e
1 commit,
Nov 9, 2017
1 file
+
15
−
27
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bob/bio/video/test/test_databases.py
+
15
−
27
View file @ 181da91e
Show full file
@@ -25,20 +25,29 @@ from bob.bio.base.test.utils import db_available
from
bob.bio.base.test.test_database_implementations
import
check_database_zt
from
bob.bio.face.test.test_databases
import
_check_annotations
import
pkg_resources
from
..database.youtube
import
YoutubeBioFile
import
os
@db_available
(
'
youtube
'
)
def
test_youtube
():
database
=
bob
.
bio
.
base
.
load_resource
(
'
youtube
'
,
'
database
'
,
preferred_package
=
'
bob.bio.video
'
)
database
=
bob
.
bio
.
base
.
load_resource
(
'
youtube
'
,
'
database
'
,
preferred_package
=
'
bob.bio.video
'
)
# test the load method:
youtube_bio_file
=
database
.
all_files
()[
0
]
directory
=
pkg_resources
.
resource_filename
(
'
bob.bio.video
'
,
'
test/data
'
)
frame_container
=
youtube_bio_file
.
load
(
directory
=
directory
,
extension
=
"
.jpg
"
)
assert
(
len
(
frame_container
)
==
2
)
# normal tests
try
:
check_database_zt
(
database
,
training_depends
=
True
,
models_depend
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
try
:
_check_annotations
(
database
,
limit_files
=
1000
,
topleft
=
True
,
framed
=
True
)
_check_annotations
(
database
,
limit_files
=
1000
,
topleft
=
True
,
framed
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The annotations could not be queried; probably the annotation files are missing. Here is the error:
'
%s
'"
%
e
)
@@ -46,31 +55,10 @@ def test_youtube():
@db_available
(
'
mobio
'
)
def
test_mobio
():
database
=
bob
.
bio
.
base
.
load_resource
(
'
mobio
'
,
'
database
'
,
preferred_package
=
'
bob.bio.video
'
)
database
=
bob
.
bio
.
base
.
load_resource
(
'
mobio
'
,
'
database
'
,
preferred_package
=
'
bob.bio.video
'
)
try
:
check_database_zt
(
database
,
models_depend
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
def
test_youtube_load_method
():
"""
Test the load method of the YoutubeBioFile class.
"""
database
=
bob
.
bio
.
base
.
load_resource
(
'
youtube
'
,
'
database
'
,
preferred_package
=
'
bob.bio.video
'
)
f
=
database
.
all_files
()[
0
]
youtube_bio_file
=
YoutubeBioFile
(
f
)
test_file
=
pkg_resources
.
resource_filename
(
'
bob.bio.video
'
,
'
test/data/Aaron_Eckhart/0/image_1.jpg
'
)
directory
=
os
.
path
.
split
(
test_file
)[
0
]
directory
=
os
.
path
.
join
(
directory
,
os
.
pardir
,
os
.
pardir
)
frame_container
=
youtube_bio_file
.
load
(
directory
=
directory
,
extension
=
"
.jpg
"
)
assert
(
len
(
frame_container
)
==
2
)
Loading