コード例 #1
0
ファイル: worldbase_test.py プロジェクト: eloseden/pygr
 def setUp(self, pygrDataPath=None, **kwargs):
     # overwrite the PYGRDATAPATH environment variable
     self.tempdir = testutil.TempDir('pygrdata')
     if pygrDataPath is None:
         pygrDataPath = self.tempdir.path
     worldbase.update(pygrDataPath, **kwargs)
     # handy shortcuts
     self.EQ = self.assertEqual
コード例 #2
0
ファイル: worldbase_test.py プロジェクト: mamanambiya/pygr
 def setUp(self, worldbasePath=None, **kwargs):
     # overwrite the WORLDBASEPATH environment variable
     self.tempdir = testutil.TempDir('pygrdata')
     if worldbasePath is None:
         worldbasePath = self.tempdir.path
     worldbase.update(worldbasePath, **kwargs)
     # handy shortcuts
     self.EQ = self.assertEqual
コード例 #3
0
ファイル: worldbase_test.py プロジェクト: antonwang/pygr
 def setUp(self, worldbasePath=None, **kwargs):
     # overwrite the WORLDBASEPATH environment variable
     self.tempdir = testutil.TempDir('pygrdata')
     if worldbasePath is None:
         worldbasePath = self.tempdir.path
     worldbase.update(worldbasePath, **kwargs)
     # handy shortcuts
     self.EQ = self.assertEqual
コード例 #4
0
ファイル: worldbase_test.py プロジェクト: eloseden/pygr
 def test_xmlrpc(self):
     "Test XMLRPC"
     worldbase.clear_cache() # force all future requests to reload
     worldbase.update("http://localhost:%s" % self.server.port) # from XMLRPC
     
     check_match(self) # run all our tests
     check_dir(self)
     check_dir_noargs(self)
     check_dir_download(self)
     check_dir_re(self)
     check_bind(self)
     check_bind2(self)
     
     sb_hbb1 = testutil.datafile('sp_hbb1') # test readonly checks
     sp2 = seqdb.BlastDB(sb_hbb1)
     sp2.__doc__ = 'another sp'
     try:
         worldbase.Bio.Seq.sp2 = sp2
         worldbase.commit()
         msg = 'failed to catch bad attempt to write to XMLRPC server'
         raise KeyError(msg)
     except ValueError:
         pass
コード例 #5
0
ファイル: worldbase_test.py プロジェクト: mamanambiya/pygr
    def test_xmlrpc(self):
        "Test XMLRPC"
        worldbase.clear_cache()  # force all future requests to reload
        # Add our test XMLRPC resource.
        worldbase.update("http://localhost:%s" % self.server.port)

        check_match(self)  # run all our tests
        check_dir(self)
        check_dir_noargs(self)
        check_dir_download(self)
        check_dir_re(self)
        check_bind(self)
        check_bind2(self)

        sb_hbb1 = testutil.datafile('sp_hbb1')  # test readonly checks
        sp2 = seqdb.BlastDB(sb_hbb1)
        sp2.__doc__ = 'another sp'
        try:
            worldbase.Bio.Seq.sp2 = sp2
            worldbase.commit()
            msg = 'failed to catch bad attempt to write to XMLRPC server'
            raise KeyError(msg)
        except ValueError:
            pass
コード例 #6
0
 def tearDown(self):
     # Restore original worldbase path to remedy lack of isolation
     # between tests from the same run
     worldbase.update(None)