Пример #1
0
    def test_connection_error(self):
        fs = FTPFS('ftp.not.a.chance', timeout=1)
        with self.assertRaises(errors.RemoteConnectionError):
            fs.listdir('/')

        with self.assertRaises(errors.RemoteConnectionError):
            fs.makedir('foo')

        with self.assertRaises(errors.RemoteConnectionError):
            fs.open('foo.txt')
Пример #2
0
    def test_connection_error(self):
        fs = FTPFS("ftp.not.a.chance", timeout=1)
        with self.assertRaises(errors.RemoteConnectionError):
            fs.listdir("/")

        with self.assertRaises(errors.RemoteConnectionError):
            fs.makedir("foo")

        with self.assertRaises(errors.RemoteConnectionError):
            fs.open("foo.txt")