Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ensembl-gh-mirror
ensembl
Commits
f70787c0
Commit
f70787c0
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
Making attribute adaptor skip anything that was a false attribute
parent
c2d9dfd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm
+1
-1
1 addition, 1 deletion
modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm
modules/t/attributeAdaptor.t
+17
-5
17 additions, 5 deletions
modules/t/attributeAdaptor.t
with
18 additions
and
6 deletions
modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm
+
1
−
1
View file @
f70787c0
...
@@ -165,7 +165,7 @@ sub store_on_ {
...
@@ -165,7 +165,7 @@ sub store_on_ {
"
argument expected.
");
"
argument expected.
");
}
}
next
if
(
$attrib
->
value
eq
'
0
')
;
next
if
!
$attrib
->
value
;
my
$atid
=
$self
->
_store_type
(
$attrib
);
my
$atid
=
$self
->
_store_type
(
$attrib
);
if
((
defined
$attrib
->
code
)
and
(
$attrib
->
code
eq
'
circular_seq
'))
{
if
((
defined
$attrib
->
code
)
and
(
$attrib
->
code
eq
'
circular_seq
'))
{
...
...
This diff is collapsed.
Click to expand it.
modules/t/attributeAdaptor.t
+
17
−
5
View file @
f70787c0
...
@@ -2,10 +2,7 @@ use strict;
...
@@ -2,10 +2,7 @@ use strict;
use
Bio::EnsEMBL::Test::
TestUtils
;
use
Bio::EnsEMBL::Test::
TestUtils
;
BEGIN
{
$|
=
1
;
use
Test::
More
;
use
Test
;
plan
tests
=>
26
;
}
use
Bio::EnsEMBL::Test::
MultiTestDB
;
use
Bio::EnsEMBL::Test::
MultiTestDB
;
use
Bio::EnsEMBL::
Attribute
;
use
Bio::EnsEMBL::
Attribute
;
...
@@ -213,7 +210,7 @@ $count = $db->dbc->db_handle->selectall_arrayref
...
@@ -213,7 +210,7 @@ $count = $db->dbc->db_handle->selectall_arrayref
ok
(
$count
==
1
);
ok
(
$count
==
1
);
@attribs
=
@
{
$aa
->
fetch_all_by_Slice
(
$slice
)};
@attribs
=
@
{
$aa
->
fetch_all_by_Slice
(
$slice
)};
print
"
attribs:
"
.
scalar
(
@attribs
)
.
"
\n
"
;
note
"
attribs:
"
.
scalar
(
@attribs
);
ok
(
@attribs
==
1
);
ok
(
@attribs
==
1
);
...
@@ -227,5 +224,20 @@ $count = $db->dbc->db_handle->selectall_arrayref
...
@@ -227,5 +224,20 @@ $count = $db->dbc->db_handle->selectall_arrayref
ok
(
$count
==
0
);
ok
(
$count
==
0
);
#
# test the skipping of empty attrib values
#
{
my
%args
=
(
-
NAME
=>
'
test_name2
',
-
CODE
=>
'
test_code2
',
-
DESCRIPTION
=>
'
test_desc2
');
my
$current_rows
=
count_rows
(
$db
,
'
seq_region_attrib
');
my
$atrib
=
Bio::EnsEMBL::
Attribute
->
new
(
%args
,);
$aa
->
store_on_Slice
(
$slice
,
[
Bio::EnsEMBL::
Attribute
->
new
(
%args
,
-
VALUE
=>
q{}
)]);
$aa
->
store_on_Slice
(
$slice
,
[
Bio::EnsEMBL::
Attribute
->
new
(
%args
,
-
VALUE
=>
0
)]);
# $aa->store_on_Slice($slice, [Bio::EnsEMBL::Attribute->new(%args, -VALUE => undef)]);
my
$new_rows
=
count_rows
(
$db
,
'
seq_region_attrib
');
is
(
$new_rows
,
$current_rows
,
'
Asserting the storage of undefined attributes will result in no values stored
');
}
$multi
->
restore
('
core
',
'
misc_attrib
',
'
seq_region_attrib
',
'
attrib_type
');
$multi
->
restore
('
core
',
'
misc_attrib
',
'
seq_region_attrib
',
'
attrib_type
');
done_testing
();
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment