Class: TestFlockhartPlugin

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

Defined Under Namespace

Classes: StubApp

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



229
230
231
232
# File 'test/test_plugin/flockhart.rb', line 229

def setup
  app = StubApp.new
  @plugin = ODDB::Interaction::FlockhartPlugin.new(app, false)
end

- (Object) test_fetch_page



233
234
235
# File 'test/test_plugin/flockhart.rb', line 233

def test_fetch_page
  #@plugin.fetch_page("table.htm")
end


236
237
238
239
# File 'test/test_plugin/flockhart.rb', line 236

def test_get_table_links
  @plugin.get_table_links
  assert_equal({}, @plugin.parsing_errors)
end

- (Object) test_parse_detail_pages



240
241
242
243
244
245
246
# File 'test/test_plugin/flockhart.rb', line 240

def test_parse_detail_pages
  result = @plugin.parse_detail_pages
  #assert_equal(10, result.keys.size)
  assert_equal(9, result.keys.size)
  assert_equal(24, result['1A2'].substrates.size)
  assert_equal(24, result['2D6'].inhibitors.size)
end

- (Object) test_parse_table



247
248
249
250
251
252
253
254
255
# File 'test/test_plugin/flockhart.rb', line 247

def test_parse_table
  result = @plugin.parse_table
  assert_equal(9, result.size)
  assert_equal(24, result['1A2'].substrates.size)
  inhs = result['1A2'].inhibitors
  assert_equal(9, inhs.size)
  inh = inhs.find { |i| i.name == 'fluvoxamine' }
  assert_equal("5", inh.auc_factor)
end

- (Object) test_parse_table__categories



256
257
258
259
260
# File 'test/test_plugin/flockhart.rb', line 256

def test_parse_table__categories
  result = @plugin.parse_table
  subs = result['2C9'].substrates
  assert_equal(5, subs.collect { |sub| sub.category }.uniq.size)
end