~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2007-10-19 13:19:48 UTC
  • mto: (2949.3.1 157752)
  • mto: This revision was merged to the branch mainline in revision 2953.
  • Revision ID: v.ladeuil+lp@free.fr-20071019131948-g5793d6onl5ik5sm
Separate transport from test server.

* bzrlib/transport/ftp.py:
Move ftp test server to its own file.
(get_test_permutations): Reworked around FTPServerFeature.

* bzrlib/tests/test_ftp_transport.py:
(TestCaseWithFTPServer.setUp): Use FTPServerFeature instead of
MedusaFeature.

* bzrlib/tests/__init__.py:
(_FTPServerFeature): New feature allowing a cleaner separation
between ftp.py and FTPServer.py.

* bzrlib/tests/FTPServer.py: 
New file. Extracted from bzrlib/transport/ftp.py (use case for
tracking moving lines).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2688
2688
        except UnicodeDecodeError:
2689
2689
            return char
2690
2690
    return None
 
2691
 
 
2692
 
 
2693
class _FTPServerFeature(Feature):
 
2694
    """Some tests want an FTP Server, check if one is available.
 
2695
 
 
2696
    Right now, the only way this is available is if 'medusa' is installed.
 
2697
    http://www.amk.ca/python/code/medusa.html
 
2698
    """
 
2699
 
 
2700
    def _probe(self):
 
2701
        try:
 
2702
            import bzrlib.tests.FTPServer
 
2703
            return True
 
2704
        except ImportError:
 
2705
            return False
 
2706
 
 
2707
    def feature_name(self):
 
2708
        return 'FTPServer'
 
2709
 
 
2710
FTPServerFeature = _FTPServerFeature()