test/rbbt/entity/test_identifiers.rb in rbbt-util-5.37.8 vs test/rbbt/entity/test_identifiers.rb in rbbt-util-5.37.9
- old
+ new
@@ -5,18 +5,20 @@
module Gene
extend Entity
end
-require 'rbbt/sources/kegg'
-require 'rbbt/sources/organism'
-Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
-Gene.add_identifiers KEGG.identifiers
-Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
-Gene.add_identifiers KEGG.identifiers
-
class TestEntityIdentifiers < Test::Unit::TestCase
+ def setup
+ require 'rbbt/sources/kegg'
+ require 'rbbt/sources/organism'
+ Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
+ Gene.add_identifiers KEGG.identifiers
+ Gene.add_identifiers Organism.identifiers("NAMESPACE"), "Ensembl Gene ID", "Associated Gene Name"
+ Gene.add_identifiers KEGG.identifiers
+
+ end
def test_name
Gene.add_identifiers datafile_test('identifiers'), "Ensembl Gene ID", "Associated Gene Name"
assert_equal "TP53", Gene.setup("ENSG00000141510").name
end
@@ -60,10 +62,10 @@
mod_name = Misc.camel_case(key_field.gsub(/\s+/,'_').sub(/_ID$/,''))
Object.const_set(mod_name, mod)
mod.instance_eval do
extend Entity
add_identifiers Path.setup(description_file), key_field, description_field
-
+
annotation :format
end
entity = "CORUM:6052"
mod.setup(entity, :format => key_field)
puts entity.name