def test_store(self): uri = os.environ.get('FEEDTEST_FTP_URI') path = os.environ.get('FEEDTEST_FTP_PATH') if not (uri and path): raise unittest.SkipTest("No FTP server available for testing") st = FTPFeedStorage(uri) verifyObject(IFeedStorage, st) return self._assert_stores(st, path)
def test_store_active_mode(self): uri = os.environ.get('FEEDTEST_FTP_URI') path = os.environ.get('FEEDTEST_FTP_PATH') if not (uri and path): raise unittest.SkipTest("No FTP server available for testing") use_active_mode = {'FEED_STORAGE_FTP_ACTIVE': True} crawler = get_crawler(settings_dict=use_active_mode) st = FTPFeedStorage.from_crawler(crawler, uri) verifyObject(IFeedStorage, st) return self._assert_stores(st, path)
def test_uri_auth_quote(self): # RFC3986: 3.2.1. User Information pw_quoted = quote(string.punctuation, safe='') st = FTPFeedStorage('ftp://*****:*****@example.com/some_path' % pw_quoted) self.assertEqual(st.password, string.punctuation)