Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
f7cb7c9f
There was a problem fetching the pipeline summary.
Commit
f7cb7c9f
authored
8 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Added check for existing protocol directory
parent
90e2ea05
No related branches found
No related tags found
1 merge request
!59
Resolve "strange behaviour when retrieving objects from bob.bio.base filelist database query"
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/base/database/filelist/query.py
+5
-0
5 additions, 0 deletions
bob/bio/base/database/filelist/query.py
bob/bio/base/test/test_filelist.py
+4
-7
4 additions, 7 deletions
bob/bio/base/test/test_filelist.py
with
9 additions
and
7 deletions
bob/bio/base/database/filelist/query.py
+
5
−
0
View file @
f7cb7c9f
...
@@ -229,7 +229,12 @@ class FileListBioDatabase(ZTBioDatabase):
...
@@ -229,7 +229,12 @@ class FileListBioDatabase(ZTBioDatabase):
def
_list_reader
(
self
,
protocol
):
def
_list_reader
(
self
,
protocol
):
if
protocol
not
in
self
.
list_readers
:
if
protocol
not
in
self
.
list_readers
:
if
protocol
is
not
None
:
protocol_dir
=
os
.
path
.
join
(
self
.
get_base_directory
(),
protocol
)
if
not
os
.
path
.
isdir
(
protocol_dir
):
raise
ValueError
(
"
The directory %s for the given protocol
'
%s
'
does not exist
"
%
(
protocol_dir
,
protocol
))
self
.
list_readers
[
protocol
]
=
ListReader
(
self
.
keep_read_lists_in_memory
)
self
.
list_readers
[
protocol
]
=
ListReader
(
self
.
keep_read_lists_in_memory
)
return
self
.
list_readers
[
protocol
]
return
self
.
list_readers
[
protocol
]
def
_make_bio
(
self
,
files
):
def
_make_bio
(
self
,
files
):
...
...
This diff is collapsed.
Click to expand it.
bob/bio/base/test/test_filelist.py
+
4
−
7
View file @
f7cb7c9f
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
import
os
import
os
import
bob.io.base.test_utils
import
bob.io.base.test_utils
from
bob.bio.base.database
import
FileListBioDatabase
from
bob.bio.base.database
import
FileListBioDatabase
import
nose.tools
example_dir
=
os
.
path
.
realpath
(
bob
.
io
.
base
.
test_utils
.
datafile
(
'
.
'
,
__name__
,
'
data/example_filelist
'
))
example_dir
=
os
.
path
.
realpath
(
bob
.
io
.
base
.
test_utils
.
datafile
(
'
.
'
,
__name__
,
'
data/example_filelist
'
))
...
@@ -124,6 +125,8 @@ def test_query_protocol():
...
@@ -124,6 +125,8 @@ def test_query_protocol():
assert
db
.
client_id_from_model_id
(
'
6
'
,
group
=
None
)
==
'
6
'
assert
db
.
client_id_from_model_id
(
'
6
'
,
group
=
None
)
==
'
6
'
assert
db
.
client_id_from_t_model_id
(
'
7
'
,
group
=
None
)
==
'
7
'
assert
db
.
client_id_from_t_model_id
(
'
7
'
,
group
=
None
)
==
'
7
'
nose
.
tools
.
assert_raises
(
ValueError
,
db
.
objects
,
protocol
=
'
non-existent
'
)
def
test_query_dense
():
def
test_query_dense
():
db
=
FileListBioDatabase
(
example_dir
,
'
test
'
,
probes_filename
=
'
for_probes.lst
'
)
db
=
FileListBioDatabase
(
example_dir
,
'
test
'
,
probes_filename
=
'
for_probes.lst
'
)
...
@@ -162,13 +165,7 @@ def test_multiple_extensions():
...
@@ -162,13 +165,7 @@ def test_multiple_extensions():
assert
file_name
==
os
.
path
.
join
(
example_dir
,
file
.
path
+
'
.pos
'
)
assert
file_name
==
os
.
path
.
join
(
example_dir
,
file
.
path
+
'
.pos
'
)
file
=
bob
.
bio
.
base
.
database
.
BioFile
(
4
,
"
data/model4_session1_sample1
"
,
"
data/model4_session1_sample1
"
)
file
=
bob
.
bio
.
base
.
database
.
BioFile
(
4
,
"
data/model4_session1_sample1
"
,
"
data/model4_session1_sample1
"
)
try
:
nose
.
tools
.
assert_raises
(
IOError
,
db
.
original_file_name
,
file
,
False
)
file_name
=
db
.
original_file_name
(
file
,
False
)
raised
=
False
except
IOError
as
e
:
raised
=
True
assert
raised
def
test_driver_api
():
def
test_driver_api
():
...
...
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