~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/http_server.py

  • Committer: Martin Pool
  • Date: 2008-04-24 07:22:53 UTC
  • mto: This revision was merged to the branch mainline in revision 3415.
  • Revision ID: mbp@sourcefrog.net-20080424072253-opmjij7xfy38w27f
Remove every assert statement from bzrlib!

Depending on the context they are:

 * turned into an explicit if/raise of either AssertionError 
   or something more specific -- particularly where they protect
   programming interfaces, complex invariants, or data file integrity
 * removed, if they're redundant with a later check, not protecting
   a meaningful invariant
 * turned into a selftest method on tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
496
496
        """
497
497
        # XXX: TODO: make the server back onto vfs_server rather than local
498
498
        # disk.
499
 
        assert backing_transport_server is None or \
500
 
            isinstance(backing_transport_server, local.LocalURLServer), \
501
 
            "HTTPServer currently assumes local transport, got %s" % \
502
 
            backing_transport_server
 
499
        if not (backing_transport_server is None or \
 
500
                isinstance(backing_transport_server, local.LocalURLServer)):
 
501
            raise AssertionError(
 
502
                "HTTPServer currently assumes local transport, got %s" % \
 
503
                backing_transport_server)
503
504
        self._home_dir = os.getcwdu()
504
505
        self._local_path_parts = self._home_dir.split(os.path.sep)
505
506
        self._http_base_url = None