[Bio] / CatalogServices / testCatalogServices Repository:
ViewVC logotype

View of /CatalogServices/testCatalogServices

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (annotate)
Fri Sep 10 13:27:10 2004 UTC (15 years, 8 months ago) by efrank
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
FILE REMOVED
migrate to new standard.mk makefile.
rename a file

#!/usr/bin/env python

from CatalogServices.Catalog import Catalog
from CatalogServices.CatalogEntry import CatalogEntry
from FaST.BssFactory import  BssFactory
from FaST.SeedDataFactory import SeedDataFactory

#
# Test base class, CatalogEntry
#

ce0 = CatalogEntry( "/", "ce0", isTerminal=0)
ce1 = CatalogEntry( "/", "ce1", isTerminal=1)

if (ce0.name() != "ce0"):
    print "FAIL: CatalogEntry.name()"

if (ce0.isTerminal()):
    print "FAIL: CatalogEntry.isTerminal()"

if (not ce1.isTerminal()):
    print "FAIL: CatalogEntry.isTerminal()"


#
# addDataFactory
#

catalog = Catalog.instance()

b=BssFactory()
catalog.addDataFactory( b)
print "added a BssFactory"

s=SeedDataFactory("http://theSeed.uchicago.edu/FIG")
catalog.addDataFactory( s)
print "added a SeedFactory"


    
#
# Test Catalog
#

print "Registered factories:"
df      = catalog.getFactories()
print df, "add printout of factoryId/name"


catTop=catalog.getCatalogTop()
print "cattop name", catTop.name()
print catTop.entries()

print
def f(x): print x.path()
catalog.apply( f )


#
# Test open()
#

fik1 = catalog.open("/Bss/KEGG Buchnera")
print fik1

fik2 = catalog.open("http://theSeed.uchicago.edu/FIG/Organisms/Synechocystis sp. PCC 6803 [1148.1]")
print fik2


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3