Ignore:
Timestamp:
Aug 10, 2006, 1:54:02 PM (18 years ago)
Author:
ole
Message:

Update of flood database testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/demos/test_flood_database.py

    r3207 r3481  
    4545    fid = open(filename)
    4646
    47     for link in get_individual_studies(fid.readlines()):
     47    total_detail = 0
     48    for i, link in enumerate(get_individual_studies(fid.readlines())):
    4849        url = base_url+htmlmap(link)
    4950     
    5051        live = False 
    51         print 'Testing %s...' %link[:72],
     52        print 'Testing link %d: %s...' %(i, link[:72]),
    5253        T = get_page(url)
    5354
     
    6061
    6162        if live is True:   
    62             print 'OK: Link is live'
     63            print 'OK: Link %d is live' %i
    6364        else:
    64             msg = 'FAIL: Link is not live: %s' %url
     65            msg = 'FAIL: Link %d is not live: %s' %(i,url)
    6566            raise msg
    6667
    6768
    68         # Secon tier links 
    69         for link in get_second_tier_links(T):
     69        # Secon tier links
     70       
     71        for j, link in enumerate(get_second_tier_links(T)):
    7072            url = servlet_base_url+htmlmap(link)
    7173     
    7274            live = False 
    73             print 'Testing %s...' %link[:80],
     75            print 'Testing detail %d: %s...' %(j, link[:80]),
    7476            T = get_page(url)
    7577
     
    8284
    8385            if live is True:   
    84                 print 'OK: Detail link is live'
     86                print 'OK: Detail link %d is live (total=%d)' %(j, total_detail)
    8587            else:
    8688                for line in T:
    8789                    print line.strip()               
    88                 msg = 'FAIL: Detail link is not live'
    89                 print msg
     90                msg = 'FAIL: Detail link %d is not live (total=%d)' %(j, total_detail)
     91                raise msg
    9092           
     93            total_detail += 1           
    9194
    9295
Note: See TracChangeset for help on using the changeset viewer.