Skip to content

Commit

Permalink
Merge pull request #327 from Ensembl/bugfix/genebuild_version_integer
Browse files Browse the repository at this point in the history
Catch incorrect usage of 'genebuild.version' meta_key.
  • Loading branch information
james-monkeyshines committed Nov 30, 2020
2 parents 9d2ba7a + 53efa11 commit cafe03e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Bio/EnsEMBL/DataCheck/Checks/MetaKeyFormat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ sub tests {
'web_accession_source' => '(NCBI|ENA|DDBJ)',
);

my %anti_formats = (
'genebuild.version' => '\d+',
);

foreach my $meta_key (sort keys %formats) {
my $desc = "Value for $meta_key has correct format";
my $format = $formats{$meta_key};
Expand All @@ -72,6 +76,18 @@ sub tests {
}
}

foreach my $meta_key (sort keys %anti_formats) {
my $desc = "Value for $meta_key does not have incorrect format";
my $format = $anti_formats{$meta_key};
my $values = $mca->list_value_by_key($meta_key);
SKIP: {
skip "No $meta_key defined", 1 unless scalar(@$values);
foreach my $value (@$values) {
unlike($value, qr/^$format$/, $desc);
}
}
}

# For meta_values that are from other parts of the database,
# ensure that the data actually exists.
if ($self->dba->group eq 'core') {
Expand Down

0 comments on commit cafe03e

Please sign in to comment.