Class: TestHayesPlugin

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_plugin/hayes.rb

Defined Under Namespace

Classes: StubApp

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



33
34
35
36
# File 'test/test_plugin/hayes.rb', line 33

def setup
  app = StubApp.new
  @plugin = ODDB::Interaction::HayesPlugin.new(app)
end

- (Object) test_fetch_pages



37
38
39
# File 'test/test_plugin/hayes.rb', line 37

def test_fetch_pages
  #@plugin.fetch_pages
end

- (Object) test_parse_interaction_table2



58
59
60
61
62
63
64
65
66
67
68
69
# File 'test/test_plugin/hayes.rb', line 58

def test_parse_interaction_table2
  cytochromes = @plugin.parse_interaction_table
  result = []
  cytochromes['2C8'].inducers.each { |conn|
    result.push(conn.name)
  }
  expected = [
    "Phenobarbital", 
    "Primidone",
  ]
  assert_equal(expected, result)
end

- (Object) test_parse_substrate_table



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'test/test_plugin/hayes.rb', line 40

def test_parse_substrate_table
  cytochromes = @plugin.parse_substrate_table
  result = []
  cytochromes['2B6'].substrates.each { |conn|
    result.push(conn.name)
  }
  expected = [
    "Bupropion",
    "Cyclophosphamide",
    "Efavirenz",
    "Ifosfamide",
    "Methadone",
    "Tamoxifen",
  ]
  assert_equal(expected, result)
  assert_equal([], cytochromes['1A2'].inhibitors)
end