summaryrefslogtreecommitdiff
path: root/test/rdf_check.rb
blob: d8838a5fc64bf1ce6e8b1083169fa942b5cfd79c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require File.join(File.expand_path(File.dirname(__FILE__)),"setup.rb")

class UploadTest < Test::Unit::TestCase

  def setup
  end
  
  def teardown
  end
 
  def test_01_check_rdf_with_ToxBank_specific_fields_on_BII_I_1
    id = OpenTox::Authorization.authenticate($aa[:user],$aa[:password])
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Term Source Name, OBI, DOID, BTO, NEWT, UO, CHEBI, PATO, TBP, TBC, TBO, TBU, TBK]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Investigation Identifier, BII\-I\-1]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Investigation Title, Growth control of the eukaryote cell\: a systems biology study in yeast]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Investigation Description, Background Cell growth underlies many key cellular and developmental processes]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Owning Organisation URI, TBO\:G176, 	Public]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Consortium URI, TBC\:G2, Douglas Connect]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Principal Investigator URI, TBU\:U115, Glenn	Myatt]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/0`.chomp
    assert_match /[Investigation keywords, TBK\:Blotting, Southwestern;TBK\:Molecular Imaging;DOID\:primary carcinoma of the liver cells]/, response
  end
  
  def test_02_check_rdf_with_ToxBank_specific_fields_on_E_MTAB
    id = OpenTox::Authorization.authenticate($aa[:user],$aa[:password])
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
    assert_match /[Investigation Identifier, E\-MTAB\-798]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
    assert_match /[Investigation Title, Open TG\-GATEs \(in vitro, human\)]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
    assert_match /[Investigation Description, The Toxicogenomics Project was a 5\-year collaborative project]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
    assert_match /[Owning Organisation URI, TBO\:G176, Public]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
    assert_match /[Consortium URI, TBC:G2, Douglas Connect]/, response
    response = `curl -i -k -H subjectid:#{id} -H accept:application/rdf+xml https://toxbank-dev.in-silico.ch/2`.chomp
    assert_match /[Investigation keywords, TBK\:Fluxomics]/, response
  end
  
end