view · edit · sidebar · attach · print · history

20110301-testcases-oddb_org

<< | Index | >>


  1. Update list
  2. Debug export_oddb_csv

Goal/Estimate
  • test-cases test_view oddb.org / 100%
Milestones
Summary
Commits

Update list

  • test_state/admin
    1. activeagent.rb: no failue, no error
    2. companyuser.rb: 2 errors solved
    3. fachinfoconfirm.rb: no failue, no error
    4. galenicform.rb: no failue, no error
    5. galenicgroup.rb: no failue, no error
    6. login.rb: 1 error solved
    7. mergegalenicform.rb: 6 errors solved
    8. patinfo_stats.rb: no failure, no error
    9. root.rb: 1 error solved
  • test_state/companies
    1. companylist.rb: no failue, no error
    2. company.rb: 7 errors solved
    3. mergecompanies.rb: no failure, no error
  • test_state/drugs
    1. incompleteregistrations.rb: no failue, no error
    2. init.rb: 2 errors, 2 failures solved
    3. register_download.rb: no failue, no error
    4. result.rb: no failue, no error
  • test_state/interactions
    1. basket.rb: no failue, no error
    2. result.rb: no failue, no error
  • test_state/paypal
    1. ipn.rb: 1 error deleted
  • test_substances
    1. substance.rb: 14 errors solved
  • test_state/users
    1. download_export.rb: no failue, no error
    2. fipi_offer_input.rb: 3 errors solved
  • test_view/companies
    1. companylist.rb: 1 error solved
  • test_view/admin
    1. fachinfoconfirm.rb: no failue, no error
    2. galenicgroup.rb: no failue, no error
  • test_view/drugs
    1. resultlist.rb: 2 failures, 3 errors solved
  • test_view/user
    1. powerlink.rb: no failure, no error

Commit

Check

masa@masa ~/ywesee/oddb.org/test/test_view $ ruby suite.rb
...
33 tests, 61 assertions, 0 failures, 0 errors

masa@masa ~/ywesee/oddb.org/test/test_state $ ruby suite.rb 
...
88 tests, 191 assertions, 2 failures, 3 errors

Note

  • But the tests can pass independently

Commit

Debug export_oddb_csv

Email

Plugin: ODDB::CsvExportPlugin
Error: NoMethodError
Message: undefined method `bsv_dossier' for nil:NilClass
Backtrace:
/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `send'
/usr/lib64/ruby/site_ruby/1.8/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/view/drugs/csv_result.rb:72:in `bsv_dossier'
/var/www/oddb.org/src/view/drugs/csv_result.rb:315:in `send'
/var/www/oddb.org/src/view/drugs/csv_result.rb:315:in `to_csv'
/var/www/oddb.org/src/view/drugs/csv_result.rb:313:in `collect'
/var/www/oddb.org/src/view/drugs/csv_result.rb:313:in `to_csv'
/var/www/oddb.org/src/view/drugs/csv_result.rb:311:in `each'
/var/www/oddb.org/src/view/drugs/csv_result.rb:311:in `to_csv'
/var/www/oddb.org/src/view/drugs/csv_result.rb:309:in `each'
/var/www/oddb.org/src/view/drugs/csv_result.rb:309:in `to_csv'
/var/www/oddb.org/src/view/drugs/csv_result.rb:330:in `to_csv_file'
/var/www/oddb.org/src/view/drugs/csv_result.rb:330:in `open'
/var/www/oddb.org/src/view/drugs/csv_result.rb:330:in `to_csv_file'
/var/www/oddb.org/src/plugin/csv_export.rb:54:in `_export_drugs'
/var/www/oddb.org/src/plugin/csv_export.rb:24:in `export_drugs'
/var/www/oddb.org/src/util/updater.rb:81:in `export_oddb_csv'
/var/www/oddb.org/src/util/updater.rb:461:in `call'
/var/www/oddb.org/src/util/updater.rb:461:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:79:in `export_oddb_csv'
/var/www/oddb.org/src/util/updater.rb:266:in `update_bsv_followers'
(eval):1:in `_admin'
/var/www/oddb.org/src/util/failsafe.rb:9:in `call'
/var/www/oddb.org/src/util/failsafe.rb:9:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:1399:in `_admin'
/var/www/oddb.org/src/util/oddbapp.rb:1397:in `initialize'
/var/www/oddb.org/src/util/oddbapp.rb:1397:in `new'
/var/www/oddb.org/src/util/oddbapp.rb:1397:in `_admin'
/usr/lib64/ruby/1.8/drb/drb.rb:1555:in `__send__'
/usr/lib64/ruby/1.8/drb/drb.rb:1555:in `perform_without_block'
/usr/lib64/ruby/1.8/drb/drb.rb:1515:in `perform'
/usr/lib64/ruby/1.8/drb/drb.rb:1589:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1585:in `loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1585:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1581:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1581:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1430:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1427:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1427:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1347:in `initialize'
/usr/lib64/ruby/1.8/drb/drb.rb:1627:in `new'
/usr/lib64/ruby/1.8/drb/drb.rb:1627:in `start_service'
/var/www/oddb.org/bin/oddbd:38

Next

  • Traceback the error message

Experiment

  def to_csv(keys, symbol=:active_packages)
    eans = {}
    result = []
    lang = @lookandfeel.language
    header = keys.collect { |key|
      @lookandfeel.lookup("th_#{key}") || key.to_s
    }
    result.push(header)
print "self.class="
p self.class
print '@model.class='
p @model.class
print '@model.length='
p @model.length
exit
    @model.each { |atc|
      result.push(['#MGrp', atc.code.to_s, atc.description(lang).to_s])
      atc.send(symbol).each { |pack|
        eans[pack.ikskey] = eans[pack.ikskey].to_i + 1
        line = keys.collect { |key|
          if(self.respond_to?(key))
            self.send(key, pack)
          else
            pack.send(key)
          end
        }
        result.push(line)
      }
    }
    @duplicates = eans.collect { |ikskey, count| 
      ikskey if count > 1 }.compact.sort
    result.collect { |line|
      CSV.generate_line(line, ';')
    }.join("\n")
  end

Run

  • oddb.org/bin/oddbd
  • oddb.org/ext/export/bin/exportd
  • oddb.org/ext/meddata/bin/meddatad

Run export_oddb_csv

masa@masa ~/ywesee/oddb.org $ bin/admin
ch.oddb> Updater.new(self).export_oddb_csv

Result

self.class=ODDB::View::Drugs::CsvResult
@model.class=Array
@model.length=7367

Experiment

  def bsv_dossier(pack)
    if(sl = pack.sl_entry)
begin
      dossier = sl.bsv_dossier
rescue => e
  raise e.message + " package ean code=" + pack.barcode.to_s
end
      if dossier
        @bsv_dossiers.store dossier, true
        @counts['bsv_dossiers'] = @bsv_dossiers.size
      end
      dossier
    end
  end

Restart

  • oddb.org/bin/oddbd

Result

admin@ywesee.com
 To &#33258;&#20998;

&#35443;&#32048;&#12434;&#34920;&#31034; 14:21 (18&#20998;&#21069;)

anthroposophy                      294
bsv_dossiers                      3315
complementary                      282
deductible_g                      8624
deductible_o                        48
duplicates                           0
expiration_date                  21788
export_registrations               650
galenic_forms                      321
generics                          4609
has_generic                          0
homeopathy                         810
inactive_date                     4249
limitation_both                    142
limitation_points                  142
limitation_texts                  1315
limitations                       1315
lppv                               601
missing_size                        27
originals                         2105
out_of_trade                      3390
phytotherapy                      1339
price_exfactory                   9846
price_public                     12386
registration_date                23421
routes_of_administration             0
sl_entries                        8672

Note

  • Succeeded

Commit

view · edit · sidebar · attach · print · history
Page last modified on March 02, 2011, at 04:50 PM