view · edit · sidebar · attach · print · history

20110222-testcases-updater-oddb_org

<< Masa.20110223-output-order-bbmb | 2011 | Masa.20110221-testcases-updater-oddb_org >>


  1. Update test-cases updater.rb
  2. txt2xls suspend
  3. Check data structure of bbmb

Goal/Estimate
  • update test-cases updater.rb / 70%
Milestones
Summary
Commits

Update test-cases updater.rb

Note

  • If I execute suite.rb, the following errors come
  1) Failure:
test_log_info(ODDB::TestUpdater) [./updater.rb:105]:
<{:recipients=>[]}> expected but was
<{:recipients=>["mhatakeyama@ywesee.com"]}>.

  2) Failure:
test_recipients(ODDB::TestUpdater) [./updater.rb:99]:
<[]> expected but was
<["mhatakeyama@ywesee.com"]>.

  3) Failure:
test_last_medication_update(TestOddbApp) [./oddbapp.rb:755]:
<Tue, 22 Feb 2011> expected but was
<Sat, 01 Jan 2011>.

429 tests, 670 assertions, 3 failures, 0 errors

Note

  • The errors do not come if only the updater.rb or the oddbapp.rb runs

Updated test-cases

  • test_logfile_stats (for test/test_util/oddbapp.rb)
    • 'instance_eval('@@today = ...')' influences on the oddbapp.rb#test_last_medication_update
  • test_recipients
  • test_log_info

Commit

  • Updated test/test_util/updater.rb. All the test/test_util/suite.rb passed. (oddb.org)
  • test_update_immediate
  • test_update_notify_simple
  • test_update_simple
  • test_update_comarketing
  • test_update_company_textinfos
  • test_update_textinfo_news
  • test_update_doctors
  • test_update_textinfos
  • test_update_interactions
  • test_update_lppv
  • test_update_medwin_companies
  • test_update_medwin_packages
  • test_update_price_feeds
  • test_update_trade_status
  • test_update_narcotics
  • test_update_swissmedic
  • test_update_swissmedicjournal
  • test_update_swissreg
  • test_update_swissreg_news
  • test_update_vaccines
  • test_update_whocc
  • test_run_random
  • test_update_bsv_followers
  • test_update_swissmedic_followers
  • test_run

Commit

txt2xls

Task

Reference

Memo

  • Order files: sandoz.xmlconv.bbmb.ch/var/output
  • Artikel and Kunden files: sandoz.bbmb.ch/var/backup

Design

  1. search directory
  2. get KundenNo and Date

suspend

Check data structure of bbmb

lib/bbmb/util/server.rb

      #def masa
      def masa(id)
        # sample 
        # ch.bbmb> masa(4100611725)
        # -> 1
          #Model::Customer.find_by_customer_id(id).orders[0].length
        open("/home/masa/work/test.dat","w") do |f|
          #Model::Customer.find_by_customer_id(id).orders[0].positions[0].description
          #Model::Customer.find_by_customer_id(id).orders[0].positions[0].commit_date
          dates = []
          Model::Customer.find_by_customer_id(id).orders.each do |order|
            dates << order.commit_time
          end
          dates.sort.each do |date|
            f.puts date
          end
        end
=begin
        open("/home/masa/work/test.dat","w") do |f|
          BBMB.persistence.all(Model::Order).select { |order|
            #order.commit_time && range.include?(order.commit_time)
            f.puts order.commit_time
          }
        end
        "done"
=end
      end

Run

masa@masa ~/ywesee/bbmb $ bin/admin
ch.bbmb>  masa(4100606423)
-> Array

Result

Mon Jan 14 13:19:01 +0100 2008
Wed Jan 23 14:16:36 +0100 2008
Wed Jan 30 11:40:50 +0100 2008
Mon Feb 04 11:13:08 +0100 2008
Wed Feb 13 14:23:27 +0100 2008
Wed Feb 20 11:09:14 +0100 2008
Wed Feb 27 14:06:26 +0100 2008
Mon Mar 03 12:55:53 +0100 2008
Tue Apr 29 11:40:03 +0200 2008
Mon May 05 10:39:47 +0200 2008
...

Note

  • I can see all the commit time of orders of the customer
view · edit · sidebar · attach · print · history
Page last modified on May 08, 2012, at 06:57 PM