Changeset 999:8d0c84ff8f59


Ignore:
Timestamp:
Nov 14, 2010, 11:06:25 PM (11 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Refactored some of the tests for non-ASCII unicode checks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test_real_ftp.py

    r998 r999  
    701701        self.assert_unicode_error(host.chdir, u"ä")
    702702
    703     def test_mkdir(self):
    704         self.assert_unicode_error(self.host.mkdir, u"ä")
    705 
    706     def test_makedirs(self):
    707         self.assert_unicode_error(self.host.makedirs, u"b/ä")
    708 
    709     def test_rmdir(self):
    710         self.assert_unicode_error(self.host.rmdir, u"ä")
    711 
    712     def test_remove(self):
    713         self.assert_unicode_error(self.host.remove, u"ä")
    714 
    715     def test_rmtree(self):
    716         self.assert_unicode_error(self.host.rmtree, u"ä")
    717 
    718703    def test_rename(self):
    719704        self.assert_unicode_error(self.host.rename, u"ä", "b")
    720705        self.assert_unicode_error(self.host.rename, "b", u"ä")
    721706
    722     def test_listdir(self):
    723         self.assert_unicode_error(self.host.listdir, u"ä")
    724 
    725     def test_lstat(self):
    726         self.assert_unicode_error(self.host.lstat, u"ä")
    727 
    728     def test_stat(self):
    729         self.assert_unicode_error(self.host.stat, u"ä")
    730 
    731707    def test_walk(self):
    732         generator = self.host.walk(u"ä")
    733708        # The string test is only executed when the first item is
    734709        #  requested from the generator.
    735         self.assert_unicode_error(generator.next)
     710        iterator = self.host.walk(u"ä")
     711        self.assert_unicode_error(iterator.next)
    736712
    737713    def test_chmod(self):
    738714        self.assert_unicode_error(self.host.chmod, u"ä", 0644)
     715
     716    def test_single_path_methods(self):
     717        # Collective test for similar tests which use just a single
     718        #  path as argument.
     719        for method_name in \
     720          "mkdir makedirs rmdir remove rmtree listdir lstat stat".split():
     721            method = getattr(self.host, method_name)
     722            self.assert_unicode_error(method, u"ä")
    739723
    740724    def test_path(self):
Note: See TracChangeset for help on using the changeset viewer.