Changeset 1911:925fdea3d316


Ignore:
Timestamp:
Jan 3, 2020, 7:37:56 PM (3 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Wrap some paths in `pathlib.Path`

We should have at least _some_ tests that test `PathLike` objects
(see ticket #119).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test_real_ftp.py

    r1890 r1911  
    1515import operator
    1616import os
     17import pathlib
    1718import time
    1819import stat
     
    411412        self.cleaner.add_file("_testfile2_")
    412413        self.make_remote_file("_testfile1_")
    413         host.rename("_testfile1_", "_testfile2_")
     414        host.rename(pathlib.Path("_testfile1_"), "_testfile2_")
    414415        assert not host.path.exists("_testfile1_")
    415         assert host.path.exists("_testfile2_")
     416        assert host.path.exists(pathlib.Path("_testfile2_"))
    416417
    417418    def test_rename_with_spaces_in_directory(self):
     
    419420        dir_name = "_dir with spaces_"
    420421        self.cleaner.add_dir(dir_name)
    421         host.mkdir(dir_name)
     422        host.mkdir(pathlib.Path(dir_name))
    422423        self.make_remote_file(dir_name + "/testfile1")
    423         host.rename(dir_name + "/testfile1", dir_name + "/testfile2")
     424        host.rename(dir_name + "/testfile1", pathlib.Path(dir_name + "/testfile2"))
    424425        assert not host.path.exists(dir_name + "/testfile1")
    425426        assert host.path.exists(dir_name + "/testfile2")
Note: See TracChangeset for help on using the changeset viewer.