From a78f99ece2ed8004cf867580a979b7eea49bd1ea Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 18 May 2015 20:04:41 +0800 Subject: [PATCH 001/100] Change to consolidate cache database migration code --- CHANGES.md | 2 + sickbeard/databases/cache_db.py | 90 ++++++--------------------------- 2 files changed, 17 insertions(+), 75 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 86c5e721..48aa1e16 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ ### 0.10.0 (2015-xx-xx xx:xx:xx UTC) +* Change to consolidate cache database migration code + ### 0.9.0 (2015-05-18 14:33:00 UTC) diff --git a/sickbeard/databases/cache_db.py b/sickbeard/databases/cache_db.py index d6aa5287..cfe02fb4 100644 --- a/sickbeard/databases/cache_db.py +++ b/sickbeard/databases/cache_db.py @@ -21,88 +21,28 @@ from sickbeard import db # Add new migrations at the bottom of the list; subclass the previous migration. class InitialSchema(db.SchemaUpgrade): def test(self): - return self.hasTable("lastUpdate") + return self.hasTable('lastUpdate') def execute(self): - queries = [ - ("CREATE TABLE lastUpdate (provider TEXT, time NUMERIC);",), - ("CREATE TABLE lastSearch (provider TEXT, time NUMERIC);",), - ("CREATE TABLE db_version (db_version INTEGER);",), - ("INSERT INTO db_version (db_version) VALUES (?)", 1), + 'CREATE TABLE lastUpdate (provider TEXT, time NUMERIC)', + 'CREATE TABLE lastSearch (provider TEXT, time NUMERIC)', + 'CREATE TABLE db_version (db_version INTEGER)', + 'INSERT INTO db_version (db_version) VALUES (1)', + 'CREATE TABLE scene_exceptions (exception_id INTEGER PRIMARY KEY, indexer_id INTEGER KEY,' + ' show_name TEXT, season NUMERIC, custom NUMERIC)', + 'CREATE TABLE scene_names (indexer_id INTEGER, name TEXT)', + 'CREATE TABLE network_timezones (network_name TEXT PRIMARY KEY, timezone TEXT)', + 'CREATE TABLE scene_exceptions_refresh (list TEXT PRIMARY KEY, last_refreshed INTEGER)', + 'CREATE TABLE network_conversions (' + 'tvdb_network TEXT PRIMARY KEY, tvrage_network TEXT, tvrage_country TEXT)', + 'CREATE INDEX tvrage_idx on network_conversions (tvrage_network, tvrage_country)', ] for query in queries: - if len(query) == 1: - self.connection.action(query[0]) - else: - self.connection.action(query[0], query[1:]) + self.connection.action(query) -class AddSceneExceptions(InitialSchema): - def test(self): - return self.hasTable("scene_exceptions") - - def execute(self): - self.connection.action( - "CREATE TABLE scene_exceptions (exception_id INTEGER PRIMARY KEY, indexer_id INTEGER KEY, show_name TEXT)") - -class AddSceneNameCache(AddSceneExceptions): - def test(self): - return self.hasTable("scene_names") - - def execute(self): - self.connection.action("CREATE TABLE scene_names (indexer_id INTEGER, name TEXT)") - - -class AddNetworkTimezones(AddSceneNameCache): - def test(self): - return self.hasTable("network_timezones") - - def execute(self): - self.connection.action("CREATE TABLE network_timezones (network_name TEXT PRIMARY KEY, timezone TEXT)") - -class AddLastSearch(AddNetworkTimezones): - def test(self): - return self.hasTable("lastSearch") - - def execute(self): - self.connection.action("CREATE TABLE lastSearch (provider TEXT, time NUMERIC)") - -class AddSceneExceptionsSeasons(AddSceneNameCache): - def test(self): - return self.hasColumn("scene_exceptions", "season") - - def execute(self): - self.addColumn("scene_exceptions", "season", "NUMERIC", -1) - -class AddSceneExceptionsCustom(AddSceneExceptionsSeasons): - def test(self): - return self.hasColumn("scene_exceptions", "custom") - - def execute(self): - self.addColumn("scene_exceptions", "custom", "NUMERIC", 0) - -class AddSceneExceptionsRefresh(AddSceneExceptionsCustom): - def test(self): - return self.hasTable("scene_exceptions_refresh") - - def execute(self): - self.connection.action( - "CREATE TABLE scene_exceptions_refresh (list TEXT PRIMARY KEY, last_refreshed INTEGER)") - - -class AddNetworkConversions(AddSceneExceptionsRefresh): - def test(self): - return self.hasTable('network_conversions') - - def execute(self): - self.connection.action('CREATE TABLE network_conversions (tvdb_network TEXT PRIMARY KEY, tvrage_network TEXT,' - ' tvrage_country TEXT)') - - self.connection.action('CREATE INDEX tvrage_idx on network_conversions (tvrage_network, tvrage_country)') - - -class ConsolidateProviders(AddNetworkConversions): +class ConsolidateProviders(InitialSchema): def test(self): return self.checkDBVersion() > 1 From 9ad4b4cd3005cebd0770f4cf9e0b6a861a5b7143 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Mon, 18 May 2015 19:49:45 +0100 Subject: [PATCH 002/100] Remove EZRSS provider. --- CHANGES.md | 1 + .../interfaces/default/config_providers.tmpl | 1 - sickbeard/__init__.py | 2 +- sickbeard/helpers.py | 10 +- sickbeard/providers/__init__.py | 3 +- sickbeard/providers/ezrss.py | 172 ------------------ sickbeard/search.py | 4 +- 7 files changed, 7 insertions(+), 186 deletions(-) delete mode 100644 sickbeard/providers/ezrss.py diff --git a/CHANGES.md b/CHANGES.md index 86c5e721..35f2699f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,5 @@ ### 0.10.0 (2015-xx-xx xx:xx:xx UTC) +* Remove EZRSS provider ### 0.9.0 (2015-05-18 14:33:00 UTC) diff --git a/gui/slick/interfaces/default/config_providers.tmpl b/gui/slick/interfaces/default/config_providers.tmpl index f0489db9..67a05759 100644 --- a/gui/slick/interfaces/default/config_providers.tmpl +++ b/gui/slick/interfaces/default/config_providers.tmpl @@ -110,7 +110,6 @@ $curProvider.name $curProvider.name <%= '*' if not curProvider.supportsBacklog else '' %> -<%= '**' if 'EZRSS' == curProvider.name else '' %> #end for diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 722010fd..cc938574 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -35,7 +35,7 @@ import sickbeard sys.path.append(os.path.abspath('../lib')) from sickbeard import providers, metadata, config, webserveInit from sickbeard.providers.generic import GenericProvider -from providers import ezrss, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \ +from providers import btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \ omgwtfnzbs, scc, hdtorrents, torrentday, hdbits, nextgen, speedcd, nyaatorrents, torrentbytes, \ freshontv, bitsoup, tokyotoshokan, animenzb, totv from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, \ diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 203504de..2c51bfb1 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -562,21 +562,15 @@ def get_all_episodes_from_absolute_number(show, absolute_numbers, indexer_id=Non return (season, episodes) -def sanitizeSceneName(name, ezrss=False): +def sanitizeSceneName(name): """ Takes a show name and returns the "scenified" version of it. - ezrss: If true the scenified version will follow EZRSS's cracksmoker rules as best as possible - Returns: A string containing the scene version of the show name given. """ if name: - if not ezrss: - bad_chars = u",:()'!?\u2019" - # ezrss leaves : and ! in their show names as far as I can tell - else: - bad_chars = u",()'?\u2019" + bad_chars = u",:()'!?\u2019" # strip out any bad chars for x in bad_chars: diff --git a/sickbeard/providers/__init__.py b/sickbeard/providers/__init__.py index 18ead3be..727ec2f5 100755 --- a/sickbeard/providers/__init__.py +++ b/sickbeard/providers/__init__.py @@ -16,8 +16,7 @@ # You should have received a copy of the GNU General Public License # along with SickGear. If not, see . -__all__ = ['ezrss', - 'womble', +__all__ = ['womble', 'btn', 'thepiratebay', 'kat', diff --git a/sickbeard/providers/ezrss.py b/sickbeard/providers/ezrss.py deleted file mode 100644 index 3de4ed4b..00000000 --- a/sickbeard/providers/ezrss.py +++ /dev/null @@ -1,172 +0,0 @@ -# Author: Nic Wolfe -# URL: http://code.google.com/p/sickbeard/ -# -# This file is part of SickGear. -# -# SickGear is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# SickGear is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with SickGear. If not, see . - -import urllib -import re - -try: - import xml.etree.cElementTree as etree -except ImportError: - import elementtree.ElementTree as etree - -import generic -from sickbeard.common import Quality -from sickbeard import logger, tvcache, helpers - - -class EZRSSProvider(generic.TorrentProvider): - def __init__(self): - generic.TorrentProvider.__init__(self, 'EZRSS', True, False) - self.ratio = None - self.cache = EZRSSCache(self) - self.url = 'https://www.ezrss.it/' - - def getQuality(self, item, anime=False): - - filename = item.filename - quality = Quality.sceneQuality(filename, anime) - - return quality - - def findSearchResults(self, show, episodes, search_mode, manualSearch=False): - - self.show = show - - results = {} - - if show.air_by_date or show.sports: - logger.log(self.name + u" doesn't support air-by-date or sports backloging because of limitations on their RSS search.", - logger.WARNING) - return results - - results = generic.TorrentProvider.findSearchResults(self, show, episodes, search_mode, manualSearch) - - return results - - def _get_season_search_strings(self, ep_obj): - - params = {} - - params['show_name'] = helpers.sanitizeSceneName(self.show.name, ezrss=True).replace('.', ' ').encode('utf-8') - - if ep_obj.show.air_by_date or ep_obj.show.sports: - params['season'] = str(ep_obj.airdate).split('-')[0] - elif ep_obj.show.anime: - params['season'] = "%d" % ep_obj.scene_absolute_number - else: - params['season'] = ep_obj.scene_season - - return [params] - - def _get_episode_search_strings(self, ep_obj, add_string=''): - - params = {} - - if not ep_obj: - return params - - params['show_name'] = helpers.sanitizeSceneName(self.show.name, ezrss=True).replace('.', ' ').encode('utf-8') - - if self.show.air_by_date or self.show.sports: - params['date'] = str(ep_obj.airdate) - elif self.show.anime: - params['episode'] = "%i" % int(ep_obj.scene_absolute_number) - else: - params['season'] = ep_obj.scene_season - params['episode'] = ep_obj.scene_episode - - return [params] - - def _doSearch(self, search_params, search_mode='eponly', epcount=0, age=0): - - params = {"mode": "rss"} - - if search_params: - params.update(search_params) - - search_url = self.url + 'search/index.php?' + urllib.urlencode(params) - - logger.log(u"Search string: " + search_url, logger.DEBUG) - - data = self.cache.getRSSFeed(search_url) - - if not data: - return [] - - items = data.entries - - results = [] - for curItem in items: - - (title, url) = self._get_title_and_url(curItem) - - if title and url: - logger.log(u"RSS Feed provider: [" + self.name + "] Attempting to add item to cache: " + title, logger.DEBUG) - results.append(curItem) - else: - logger.log( - u"The XML returned from the " + self.name + " RSS feed is incomplete, this result is unusable", - logger.ERROR) - - return results - - def _get_title_and_url(self, item): - (title, url) = generic.TorrentProvider._get_title_and_url(self, item) - - filename = item.filename - if filename: - new_title = self._extract_name_from_filename(filename) - if new_title: - title = new_title - logger.log(u"Extracted the name " + title + " from the torrent link", logger.DEBUG) - - return (title, url) - - def _extract_name_from_filename(self, filename): - name_regex = '(.*?)\.?(\[.*]|\d+\.TPB)\.torrent$' - logger.log(u"Comparing " + name_regex + " against " + filename, logger.DEBUG) - match = re.match(name_regex, filename, re.I) - if match: - return match.group(1) - return None - - def seedRatio(self): - return self.ratio - - -class EZRSSCache(tvcache.TVCache): - def __init__(self, provider): - - tvcache.TVCache.__init__(self, provider) - - # only poll EZRSS every 15 minutes max - self.minTime = 15 - - def _getRSSData(self): - - rss_url = self.provider.url + 'feed/' - logger.log(self.provider.name + " cache update URL: " + rss_url, logger.DEBUG) - - data = self.getRSSFeed(rss_url) - - if data and 'entries' in data: - return data.entries - else: - return [] - -provider = EZRSSProvider() diff --git a/sickbeard/search.py b/sickbeard/search.py index ab27b236..64bbd367 100644 --- a/sickbeard/search.py +++ b/sickbeard/search.py @@ -433,7 +433,7 @@ def searchForNeededEpisodes(episodes): if curEp in foundResults and bestResult.quality <= foundResults[curEp].quality: continue - # filter out possible bad torrents from providers such as ezrss + # filter out possible bad torrents from providers if bestResult.resultType == "torrent" and sickbeard.TORRENT_METHOD != "blackhole": bestResult.content = None if not bestResult.url.startswith('magnet'): @@ -704,7 +704,7 @@ def searchProviders(show, episodes, manualSearch=False): if not bestResult: continue - # filter out possible bad torrents from providers such as ezrss + # filter out possible bad torrents from providers if bestResult.resultType == "torrent" and sickbeard.TORRENT_METHOD != "blackhole": bestResult.content = None if not bestResult.url.startswith('magnet'): From 5beb10b19d4869ffa74dd0875236804b2f422d6f Mon Sep 17 00:00:00 2001 From: JackDandy Date: Mon, 18 May 2015 19:08:55 +0100 Subject: [PATCH 003/100] Update Tornado webserver to 4.2b1 (61a16c9). --- CHANGES.md | 2 + tornado/__init__.py | 4 +- tornado/concurrent.py | 8 + tornado/escape.py | 5 +- tornado/gen.py | 25 +- tornado/http1connection.py | 5 +- tornado/iostream.py | 5 +- tornado/test/__init__.py | 0 tornado/test/__main__.py | 14 - tornado/test/asyncio_test.py | 69 - tornado/test/auth_test.py | 415 --- tornado/test/concurrent_test.py | 415 --- tornado/test/csv_translations/fr_FR.csv | 1 - tornado/test/curl_httpclient_test.py | 123 - tornado/test/escape_test.py | 232 -- tornado/test/gen_test.py | 1263 -------- .../test/gettext_translations/extract_me.py | 16 - .../fr_FR/LC_MESSAGES/tornado_test.mo | Bin 665 -> 0 bytes .../fr_FR/LC_MESSAGES/tornado_test.po | 47 - tornado/test/httpclient_test.py | 607 ---- tornado/test/httpserver_test.py | 1081 ------- tornado/test/httputil_test.py | 353 --- tornado/test/import_test.py | 47 - tornado/test/ioloop_test.py | 609 ---- tornado/test/iostream_test.py | 1071 ------- tornado/test/locale_test.py | 105 - tornado/test/locks_test.py | 480 --- tornado/test/log_test.py | 208 -- tornado/test/netutil_test.py | 202 -- tornado/test/options_test.cfg | 3 - tornado/test/options_test.py | 223 -- tornado/test/process_test.py | 243 -- tornado/test/queues_test.py | 403 --- tornado/test/resolve_test_helper.py | 12 - tornado/test/runtests.py | 179 -- tornado/test/simple_httpclient_test.py | 679 ----- tornado/test/stack_context_test.py | 288 -- tornado/test/static/dir/index.html | 1 - tornado/test/static/robots.txt | 2 - tornado/test/tcpclient_test.py | 280 -- tornado/test/tcpserver_test.py | 38 - tornado/test/template_test.py | 412 --- tornado/test/templates/utf8.html | 1 - tornado/test/test.crt | 15 - tornado/test/test.key | 16 - tornado/test/testing_test.py | 232 -- tornado/test/twisted_test.py | 689 ----- tornado/test/util.py | 52 - tornado/test/util_test.py | 201 -- tornado/test/web_test.py | 2636 ----------------- tornado/test/websocket_test.py | 415 --- tornado/test/wsgi_test.py | 100 - tornado/web.py | 15 +- tornado/websocket.py | 4 +- 54 files changed, 35 insertions(+), 14516 deletions(-) delete mode 100644 tornado/test/__init__.py delete mode 100644 tornado/test/__main__.py delete mode 100644 tornado/test/asyncio_test.py delete mode 100644 tornado/test/auth_test.py delete mode 100644 tornado/test/concurrent_test.py delete mode 100644 tornado/test/csv_translations/fr_FR.csv delete mode 100644 tornado/test/curl_httpclient_test.py delete mode 100644 tornado/test/escape_test.py delete mode 100644 tornado/test/gen_test.py delete mode 100644 tornado/test/gettext_translations/extract_me.py delete mode 100644 tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.mo delete mode 100644 tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.po delete mode 100644 tornado/test/httpclient_test.py delete mode 100644 tornado/test/httpserver_test.py delete mode 100644 tornado/test/httputil_test.py delete mode 100644 tornado/test/import_test.py delete mode 100644 tornado/test/ioloop_test.py delete mode 100644 tornado/test/iostream_test.py delete mode 100644 tornado/test/locale_test.py delete mode 100644 tornado/test/locks_test.py delete mode 100644 tornado/test/log_test.py delete mode 100644 tornado/test/netutil_test.py delete mode 100644 tornado/test/options_test.cfg delete mode 100644 tornado/test/options_test.py delete mode 100644 tornado/test/process_test.py delete mode 100644 tornado/test/queues_test.py delete mode 100644 tornado/test/resolve_test_helper.py delete mode 100644 tornado/test/runtests.py delete mode 100644 tornado/test/simple_httpclient_test.py delete mode 100644 tornado/test/stack_context_test.py delete mode 100644 tornado/test/static/dir/index.html delete mode 100644 tornado/test/static/robots.txt delete mode 100644 tornado/test/tcpclient_test.py delete mode 100644 tornado/test/tcpserver_test.py delete mode 100644 tornado/test/template_test.py delete mode 100644 tornado/test/templates/utf8.html delete mode 100644 tornado/test/test.crt delete mode 100644 tornado/test/test.key delete mode 100644 tornado/test/testing_test.py delete mode 100644 tornado/test/twisted_test.py delete mode 100644 tornado/test/util.py delete mode 100644 tornado/test/util_test.py delete mode 100644 tornado/test/web_test.py delete mode 100644 tornado/test/websocket_test.py delete mode 100644 tornado/test/wsgi_test.py diff --git a/CHANGES.md b/CHANGES.md index 35f2699f..72ac686a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ ### 0.10.0 (2015-xx-xx xx:xx:xx UTC) + * Remove EZRSS provider +* Update Tornado webserver to 4.2b1 (61a16c9) ### 0.9.0 (2015-05-18 14:33:00 UTC) diff --git a/tornado/__init__.py b/tornado/__init__.py index 01b926be..80f21ddd 100644 --- a/tornado/__init__.py +++ b/tornado/__init__.py @@ -25,5 +25,5 @@ from __future__ import absolute_import, division, print_function, with_statement # is zero for an official release, positive for a development branch, # or negative for a release candidate or beta (after the base version # number has been incremented) -version = "4.2.dev1" -version_info = (4, 2, 0, -100) +version = "4.2b1" +version_info = (4, 2, 0, -99) diff --git a/tornado/concurrent.py b/tornado/concurrent.py index 51ae239f..479ca022 100644 --- a/tornado/concurrent.py +++ b/tornado/concurrent.py @@ -203,6 +203,10 @@ class Future(object): def result(self, timeout=None): """If the operation succeeded, return its result. If it failed, re-raise its exception. + + This method takes a ``timeout`` argument for compatibility with + `concurrent.futures.Future` but it is an error to call it + before the `Future` is done, so the ``timeout`` is never used. """ self._clear_tb_log() if self._result is not None: @@ -215,6 +219,10 @@ class Future(object): def exception(self, timeout=None): """If the operation raised an exception, return the `Exception` object. Otherwise returns None. + + This method takes a ``timeout`` argument for compatibility with + `concurrent.futures.Future` but it is an error to call it + before the `Future` is done, so the ``timeout`` is never used. """ self._clear_tb_log() if self._exc_info is not None: diff --git a/tornado/escape.py b/tornado/escape.py index 2852cf51..2f04b468 100644 --- a/tornado/escape.py +++ b/tornado/escape.py @@ -378,7 +378,10 @@ def linkify(text, shorten=False, extra_params="", def _convert_entity(m): if m.group(1) == "#": try: - return unichr(int(m.group(2))) + if m.group(2)[:1].lower() == 'x': + return unichr(int(m.group(2)[1:], 16)) + else: + return unichr(int(m.group(2))) except ValueError: return "&#%s;" % m.group(2) try: diff --git a/tornado/gen.py b/tornado/gen.py index 4cc578eb..91457689 100644 --- a/tornado/gen.py +++ b/tornado/gen.py @@ -336,12 +336,8 @@ class WaitIterator(object): self.current_index = self.current_future = None self._running_future = None - # Use a weak reference to self to avoid cycles that may delay - # garbage collection. - self_ref = weakref.ref(self) for future in futures: - future.add_done_callback(functools.partial( - self._done_callback, self_ref)) + future.add_done_callback(self._done_callback) def done(self): """Returns True if this iterator has no more results.""" @@ -358,26 +354,17 @@ class WaitIterator(object): the inputs. """ self._running_future = TracebackFuture() - # As long as there is an active _running_future, we must - # ensure that the WaitIterator is not GC'd (due to the - # use of weak references in __init__). Add a callback that - # references self so there is a hard reference that will be - # cleared automatically when this Future finishes. - self._running_future.add_done_callback(lambda f: self) if self._finished: self._return_result(self._finished.popleft()) return self._running_future - @staticmethod - def _done_callback(self_ref, done): - self = self_ref() - if self is not None: - if self._running_future and not self._running_future.done(): - self._return_result(done) - else: - self._finished.append(done) + def _done_callback(self, done): + if self._running_future and not self._running_future.done(): + self._return_result(done) + else: + self._finished.append(done) def _return_result(self, done): """Called set the returned future's state that of the future diff --git a/tornado/http1connection.py b/tornado/http1connection.py index 5d6f4c21..6226ef7a 100644 --- a/tornado/http1connection.py +++ b/tornado/http1connection.py @@ -698,9 +698,8 @@ class HTTP1ServerConnection(object): # This exception was already logged. conn.close() return - except Exception as e: - if 1 != e.errno: - gen_log.error("Uncaught exception", exc_info=True) + except Exception: + gen_log.error("Uncaught exception", exc_info=True) conn.close() return if not ret: diff --git a/tornado/iostream.py b/tornado/iostream.py index f255dc1f..3a175a67 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -644,9 +644,8 @@ class BaseIOStream(object): pos = self._read_to_buffer_loop() except UnsatisfiableReadError: raise - except Exception as e: - if 1 != e.errno: - gen_log.warning("error on read", exc_info=True) + except Exception: + gen_log.warning("error on read", exc_info=True) self.close(exc_info=True) return if pos is not None: diff --git a/tornado/test/__init__.py b/tornado/test/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tornado/test/__main__.py b/tornado/test/__main__.py deleted file mode 100644 index 5953443b..00000000 --- a/tornado/test/__main__.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Shim to allow python -m tornado.test. - -This only works in python 2.7+. -""" -from __future__ import absolute_import, division, print_function, with_statement - -from tornado.test.runtests import all, main - -# tornado.testing.main autodiscovery relies on 'all' being present in -# the main module, so import it here even though it is not used directly. -# The following line prevents a pyflakes warning. -all = all - -main() diff --git a/tornado/test/asyncio_test.py b/tornado/test/asyncio_test.py deleted file mode 100644 index 1be0e54f..00000000 --- a/tornado/test/asyncio_test.py +++ /dev/null @@ -1,69 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from __future__ import absolute_import, division, print_function, with_statement - -import sys -import textwrap - -from tornado import gen -from tornado.testing import AsyncTestCase, gen_test -from tornado.test.util import unittest - -try: - from tornado.platform.asyncio import asyncio, AsyncIOLoop -except ImportError: - asyncio = None - -skipIfNoSingleDispatch = unittest.skipIf( - gen.singledispatch is None, "singledispatch module not present") - - -@unittest.skipIf(asyncio is None, "asyncio module not present") -class AsyncIOLoopTest(AsyncTestCase): - def get_new_ioloop(self): - io_loop = AsyncIOLoop() - asyncio.set_event_loop(io_loop.asyncio_loop) - return io_loop - - def test_asyncio_callback(self): - # Basic test that the asyncio loop is set up correctly. - asyncio.get_event_loop().call_soon(self.stop) - self.wait() - - @skipIfNoSingleDispatch - @gen_test - def test_asyncio_future(self): - # Test that we can yield an asyncio future from a tornado coroutine. - # Without 'yield from', we must wrap coroutines in asyncio.async. - x = yield asyncio.async( - asyncio.get_event_loop().run_in_executor(None, lambda: 42)) - self.assertEqual(x, 42) - - @unittest.skipIf(sys.version_info < (3, 3), - 'PEP 380 not available') - @skipIfNoSingleDispatch - @gen_test - def test_asyncio_yield_from(self): - # Test that we can use asyncio coroutines with 'yield from' - # instead of asyncio.async(). This requires python 3.3 syntax. - global_namespace = dict(globals(), **locals()) - local_namespace = {} - exec(textwrap.dedent(""" - @gen.coroutine - def f(): - event_loop = asyncio.get_event_loop() - x = yield from event_loop.run_in_executor(None, lambda: 42) - return x - """), global_namespace, local_namespace) - result = yield local_namespace['f']() - self.assertEqual(result, 42) diff --git a/tornado/test/auth_test.py b/tornado/test/auth_test.py deleted file mode 100644 index 541ecf16..00000000 --- a/tornado/test/auth_test.py +++ /dev/null @@ -1,415 +0,0 @@ -# These tests do not currently do much to verify the correct implementation -# of the openid/oauth protocols, they just exercise the major code paths -# and ensure that it doesn't blow up (e.g. with unicode/bytes issues in -# python 3) - - -from __future__ import absolute_import, division, print_function, with_statement -from tornado.auth import OpenIdMixin, OAuthMixin, OAuth2Mixin, TwitterMixin, AuthError -from tornado.concurrent import Future -from tornado.escape import json_decode -from tornado import gen -from tornado.log import gen_log -from tornado.testing import AsyncHTTPTestCase, ExpectLog -from tornado.util import u -from tornado.web import RequestHandler, Application, asynchronous, HTTPError - - -class OpenIdClientLoginHandler(RequestHandler, OpenIdMixin): - def initialize(self, test): - self._OPENID_ENDPOINT = test.get_url('/openid/server/authenticate') - - @asynchronous - def get(self): - if self.get_argument('openid.mode', None): - self.get_authenticated_user( - self.on_user, http_client=self.settings['http_client']) - return - res = self.authenticate_redirect() - assert isinstance(res, Future) - assert res.done() - - def on_user(self, user): - if user is None: - raise Exception("user is None") - self.finish(user) - - -class OpenIdServerAuthenticateHandler(RequestHandler): - def post(self): - if self.get_argument('openid.mode') != 'check_authentication': - raise Exception("incorrect openid.mode %r") - self.write('is_valid:true') - - -class OAuth1ClientLoginHandler(RequestHandler, OAuthMixin): - def initialize(self, test, version): - self._OAUTH_VERSION = version - self._OAUTH_REQUEST_TOKEN_URL = test.get_url('/oauth1/server/request_token') - self._OAUTH_AUTHORIZE_URL = test.get_url('/oauth1/server/authorize') - self._OAUTH_ACCESS_TOKEN_URL = test.get_url('/oauth1/server/access_token') - - def _oauth_consumer_token(self): - return dict(key='asdf', secret='qwer') - - @asynchronous - def get(self): - if self.get_argument('oauth_token', None): - self.get_authenticated_user( - self.on_user, http_client=self.settings['http_client']) - return - res = self.authorize_redirect(http_client=self.settings['http_client']) - assert isinstance(res, Future) - - def on_user(self, user): - if user is None: - raise Exception("user is None") - self.finish(user) - - def _oauth_get_user(self, access_token, callback): - if self.get_argument('fail_in_get_user', None): - raise Exception("failing in get_user") - if access_token != dict(key='uiop', secret='5678'): - raise Exception("incorrect access token %r" % access_token) - callback(dict(email='foo@example.com')) - - -class OAuth1ClientLoginCoroutineHandler(OAuth1ClientLoginHandler): - """Replaces OAuth1ClientLoginCoroutineHandler's get() with a coroutine.""" - @gen.coroutine - def get(self): - if self.get_argument('oauth_token', None): - # Ensure that any exceptions are set on the returned Future, - # not simply thrown into the surrounding StackContext. - try: - yield self.get_authenticated_user() - except Exception as e: - self.set_status(503) - self.write("got exception: %s" % e) - else: - yield self.authorize_redirect() - - -class OAuth1ClientRequestParametersHandler(RequestHandler, OAuthMixin): - def initialize(self, version): - self._OAUTH_VERSION = version - - def _oauth_consumer_token(self): - return dict(key='asdf', secret='qwer') - - def get(self): - params = self._oauth_request_parameters( - 'http://www.example.com/api/asdf', - dict(key='uiop', secret='5678'), - parameters=dict(foo='bar')) - self.write(params) - - -class OAuth1ServerRequestTokenHandler(RequestHandler): - def get(self): - self.write('oauth_token=zxcv&oauth_token_secret=1234') - - -class OAuth1ServerAccessTokenHandler(RequestHandler): - def get(self): - self.write('oauth_token=uiop&oauth_token_secret=5678') - - -class OAuth2ClientLoginHandler(RequestHandler, OAuth2Mixin): - def initialize(self, test): - self._OAUTH_AUTHORIZE_URL = test.get_url('/oauth2/server/authorize') - - def get(self): - res = self.authorize_redirect() - assert isinstance(res, Future) - assert res.done() - - -class TwitterClientHandler(RequestHandler, TwitterMixin): - def initialize(self, test): - self._OAUTH_REQUEST_TOKEN_URL = test.get_url('/oauth1/server/request_token') - self._OAUTH_ACCESS_TOKEN_URL = test.get_url('/twitter/server/access_token') - self._OAUTH_AUTHORIZE_URL = test.get_url('/oauth1/server/authorize') - self._TWITTER_BASE_URL = test.get_url('/twitter/api') - - def get_auth_http_client(self): - return self.settings['http_client'] - - -class TwitterClientLoginHandler(TwitterClientHandler): - @asynchronous - def get(self): - if self.get_argument("oauth_token", None): - self.get_authenticated_user(self.on_user) - return - self.authorize_redirect() - - def on_user(self, user): - if user is None: - raise Exception("user is None") - self.finish(user) - - -class TwitterClientLoginGenEngineHandler(TwitterClientHandler): - @asynchronous - @gen.engine - def get(self): - if self.get_argument("oauth_token", None): - user = yield self.get_authenticated_user() - self.finish(user) - else: - # Old style: with @gen.engine we can ignore the Future from - # authorize_redirect. - self.authorize_redirect() - - -class TwitterClientLoginGenCoroutineHandler(TwitterClientHandler): - @gen.coroutine - def get(self): - if self.get_argument("oauth_token", None): - user = yield self.get_authenticated_user() - self.finish(user) - else: - # New style: with @gen.coroutine the result must be yielded - # or else the request will be auto-finished too soon. - yield self.authorize_redirect() - - -class TwitterClientShowUserHandler(TwitterClientHandler): - @asynchronous - @gen.engine - def get(self): - # TODO: would be nice to go through the login flow instead of - # cheating with a hard-coded access token. - response = yield gen.Task(self.twitter_request, - '/users/show/%s' % self.get_argument('name'), - access_token=dict(key='hjkl', secret='vbnm')) - if response is None: - self.set_status(500) - self.finish('error from twitter request') - else: - self.finish(response) - - -class TwitterClientShowUserFutureHandler(TwitterClientHandler): - @asynchronous - @gen.engine - def get(self): - try: - response = yield self.twitter_request( - '/users/show/%s' % self.get_argument('name'), - access_token=dict(key='hjkl', secret='vbnm')) - except AuthError as e: - self.set_status(500) - self.finish(str(e)) - return - assert response is not None - self.finish(response) - - -class TwitterServerAccessTokenHandler(RequestHandler): - def get(self): - self.write('oauth_token=hjkl&oauth_token_secret=vbnm&screen_name=foo') - - -class TwitterServerShowUserHandler(RequestHandler): - def get(self, screen_name): - if screen_name == 'error': - raise HTTPError(500) - assert 'oauth_nonce' in self.request.arguments - assert 'oauth_timestamp' in self.request.arguments - assert 'oauth_signature' in self.request.arguments - assert self.get_argument('oauth_consumer_key') == 'test_twitter_consumer_key' - assert self.get_argument('oauth_signature_method') == 'HMAC-SHA1' - assert self.get_argument('oauth_version') == '1.0' - assert self.get_argument('oauth_token') == 'hjkl' - self.write(dict(screen_name=screen_name, name=screen_name.capitalize())) - - -class TwitterServerVerifyCredentialsHandler(RequestHandler): - def get(self): - assert 'oauth_nonce' in self.request.arguments - assert 'oauth_timestamp' in self.request.arguments - assert 'oauth_signature' in self.request.arguments - assert self.get_argument('oauth_consumer_key') == 'test_twitter_consumer_key' - assert self.get_argument('oauth_signature_method') == 'HMAC-SHA1' - assert self.get_argument('oauth_version') == '1.0' - assert self.get_argument('oauth_token') == 'hjkl' - self.write(dict(screen_name='foo', name='Foo')) - - -class AuthTest(AsyncHTTPTestCase): - def get_app(self): - return Application( - [ - # test endpoints - ('/openid/client/login', OpenIdClientLoginHandler, dict(test=self)), - ('/oauth10/client/login', OAuth1ClientLoginHandler, - dict(test=self, version='1.0')), - ('/oauth10/client/request_params', - OAuth1ClientRequestParametersHandler, - dict(version='1.0')), - ('/oauth10a/client/login', OAuth1ClientLoginHandler, - dict(test=self, version='1.0a')), - ('/oauth10a/client/login_coroutine', - OAuth1ClientLoginCoroutineHandler, - dict(test=self, version='1.0a')), - ('/oauth10a/client/request_params', - OAuth1ClientRequestParametersHandler, - dict(version='1.0a')), - ('/oauth2/client/login', OAuth2ClientLoginHandler, dict(test=self)), - - ('/twitter/client/login', TwitterClientLoginHandler, dict(test=self)), - ('/twitter/client/login_gen_engine', TwitterClientLoginGenEngineHandler, dict(test=self)), - ('/twitter/client/login_gen_coroutine', TwitterClientLoginGenCoroutineHandler, dict(test=self)), - ('/twitter/client/show_user', TwitterClientShowUserHandler, dict(test=self)), - ('/twitter/client/show_user_future', TwitterClientShowUserFutureHandler, dict(test=self)), - - # simulated servers - ('/openid/server/authenticate', OpenIdServerAuthenticateHandler), - ('/oauth1/server/request_token', OAuth1ServerRequestTokenHandler), - ('/oauth1/server/access_token', OAuth1ServerAccessTokenHandler), - - ('/twitter/server/access_token', TwitterServerAccessTokenHandler), - (r'/twitter/api/users/show/(.*)\.json', TwitterServerShowUserHandler), - (r'/twitter/api/account/verify_credentials\.json', TwitterServerVerifyCredentialsHandler), - ], - http_client=self.http_client, - twitter_consumer_key='test_twitter_consumer_key', - twitter_consumer_secret='test_twitter_consumer_secret') - - def test_openid_redirect(self): - response = self.fetch('/openid/client/login', follow_redirects=False) - self.assertEqual(response.code, 302) - self.assertTrue( - '/openid/server/authenticate?' in response.headers['Location']) - - def test_openid_get_user(self): - response = self.fetch('/openid/client/login?openid.mode=blah&openid.ns.ax=http://openid.net/srv/ax/1.0&openid.ax.type.email=http://axschema.org/contact/email&openid.ax.value.email=foo@example.com') - response.rethrow() - parsed = json_decode(response.body) - self.assertEqual(parsed["email"], "foo@example.com") - - def test_oauth10_redirect(self): - response = self.fetch('/oauth10/client/login', follow_redirects=False) - self.assertEqual(response.code, 302) - self.assertTrue(response.headers['Location'].endswith( - '/oauth1/server/authorize?oauth_token=zxcv')) - # the cookie is base64('zxcv')|base64('1234') - self.assertTrue( - '_oauth_request_token="enhjdg==|MTIzNA=="' in response.headers['Set-Cookie'], - response.headers['Set-Cookie']) - - def test_oauth10_get_user(self): - response = self.fetch( - '/oauth10/client/login?oauth_token=zxcv', - headers={'Cookie': '_oauth_request_token=enhjdg==|MTIzNA=='}) - response.rethrow() - parsed = json_decode(response.body) - self.assertEqual(parsed['email'], 'foo@example.com') - self.assertEqual(parsed['access_token'], dict(key='uiop', secret='5678')) - - def test_oauth10_request_parameters(self): - response = self.fetch('/oauth10/client/request_params') - response.rethrow() - parsed = json_decode(response.body) - self.assertEqual(parsed['oauth_consumer_key'], 'asdf') - self.assertEqual(parsed['oauth_token'], 'uiop') - self.assertTrue('oauth_nonce' in parsed) - self.assertTrue('oauth_signature' in parsed) - - def test_oauth10a_redirect(self): - response = self.fetch('/oauth10a/client/login', follow_redirects=False) - self.assertEqual(response.code, 302) - self.assertTrue(response.headers['Location'].endswith( - '/oauth1/server/authorize?oauth_token=zxcv')) - # the cookie is base64('zxcv')|base64('1234') - self.assertTrue( - '_oauth_request_token="enhjdg==|MTIzNA=="' in response.headers['Set-Cookie'], - response.headers['Set-Cookie']) - - def test_oauth10a_get_user(self): - response = self.fetch( - '/oauth10a/client/login?oauth_token=zxcv', - headers={'Cookie': '_oauth_request_token=enhjdg==|MTIzNA=='}) - response.rethrow() - parsed = json_decode(response.body) - self.assertEqual(parsed['email'], 'foo@example.com') - self.assertEqual(parsed['access_token'], dict(key='uiop', secret='5678')) - - def test_oauth10a_request_parameters(self): - response = self.fetch('/oauth10a/client/request_params') - response.rethrow() - parsed = json_decode(response.body) - self.assertEqual(parsed['oauth_consumer_key'], 'asdf') - self.assertEqual(parsed['oauth_token'], 'uiop') - self.assertTrue('oauth_nonce' in parsed) - self.assertTrue('oauth_signature' in parsed) - - def test_oauth10a_get_user_coroutine_exception(self): - response = self.fetch( - '/oauth10a/client/login_coroutine?oauth_token=zxcv&fail_in_get_user=true', - headers={'Cookie': '_oauth_request_token=enhjdg==|MTIzNA=='}) - self.assertEqual(response.code, 503) - - def test_oauth2_redirect(self): - response = self.fetch('/oauth2/client/login', follow_redirects=False) - self.assertEqual(response.code, 302) - self.assertTrue('/oauth2/server/authorize?' in response.headers['Location']) - - def base_twitter_redirect(self, url): - # Same as test_oauth10a_redirect - response = self.fetch(url, follow_redirects=False) - self.assertEqual(response.code, 302) - self.assertTrue(response.headers['Location'].endswith( - '/oauth1/server/authorize?oauth_token=zxcv')) - # the cookie is base64('zxcv')|base64('1234') - self.assertTrue( - '_oauth_request_token="enhjdg==|MTIzNA=="' in response.headers['Set-Cookie'], - response.headers['Set-Cookie']) - - def test_twitter_redirect(self): - self.base_twitter_redirect('/twitter/client/login') - - def test_twitter_redirect_gen_engine(self): - self.base_twitter_redirect('/twitter/client/login_gen_engine') - - def test_twitter_redirect_gen_coroutine(self): - self.base_twitter_redirect('/twitter/client/login_gen_coroutine') - - def test_twitter_get_user(self): - response = self.fetch( - '/twitter/client/login?oauth_token=zxcv', - headers={'Cookie': '_oauth_request_token=enhjdg==|MTIzNA=='}) - response.rethrow() - parsed = json_decode(response.body) - self.assertEqual(parsed, - {u('access_token'): {u('key'): u('hjkl'), - u('screen_name'): u('foo'), - u('secret'): u('vbnm')}, - u('name'): u('Foo'), - u('screen_name'): u('foo'), - u('username'): u('foo')}) - - def test_twitter_show_user(self): - response = self.fetch('/twitter/client/show_user?name=somebody') - response.rethrow() - self.assertEqual(json_decode(response.body), - {'name': 'Somebody', 'screen_name': 'somebody'}) - - def test_twitter_show_user_error(self): - with ExpectLog(gen_log, 'Error response HTTP 500'): - response = self.fetch('/twitter/client/show_user?name=error') - self.assertEqual(response.code, 500) - self.assertEqual(response.body, b'error from twitter request') - - def test_twitter_show_user_future(self): - response = self.fetch('/twitter/client/show_user_future?name=somebody') - response.rethrow() - self.assertEqual(json_decode(response.body), - {'name': 'Somebody', 'screen_name': 'somebody'}) - - def test_twitter_show_user_future_error(self): - response = self.fetch('/twitter/client/show_user_future?name=error') - self.assertEqual(response.code, 500) - self.assertIn(b'Error response HTTP 500', response.body) diff --git a/tornado/test/concurrent_test.py b/tornado/test/concurrent_test.py deleted file mode 100644 index bf90ad0e..00000000 --- a/tornado/test/concurrent_test.py +++ /dev/null @@ -1,415 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2012 Facebook -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from __future__ import absolute_import, division, print_function, with_statement - -import logging -import re -import socket -import sys -import traceback - -from tornado.concurrent import Future, return_future, ReturnValueIgnoredError, run_on_executor -from tornado.escape import utf8, to_unicode -from tornado import gen -from tornado.iostream import IOStream -from tornado import stack_context -from tornado.tcpserver import TCPServer -from tornado.testing import AsyncTestCase, LogTrapTestCase, bind_unused_port, gen_test -from tornado.test.util import unittest - - -try: - from concurrent import futures -except ImportError: - futures = None - - -class ReturnFutureTest(AsyncTestCase): - @return_future - def sync_future(self, callback): - callback(42) - - @return_future - def async_future(self, callback): - self.io_loop.add_callback(callback, 42) - - @return_future - def immediate_failure(self, callback): - 1 / 0 - - @return_future - def delayed_failure(self, callback): - self.io_loop.add_callback(lambda: 1 / 0) - - @return_future - def return_value(self, callback): - # Note that the result of both running the callback and returning - # a value (or raising an exception) is unspecified; with current - # implementations the last event prior to callback resolution wins. - return 42 - - @return_future - def no_result_future(self, callback): - callback() - - def test_immediate_failure(self): - with self.assertRaises(ZeroDivisionError): - # The caller sees the error just like a normal function. - self.immediate_failure(callback=self.stop) - # The callback is not run because the function failed synchronously. - self.io_loop.add_timeout(self.io_loop.time() + 0.05, self.stop) - result = self.wait() - self.assertIs(result, None) - - def test_return_value(self): - with self.assertRaises(ReturnValueIgnoredError): - self.return_value(callback=self.stop) - - def test_callback_kw(self): - future = self.sync_future(callback=self.stop) - result = self.wait() - self.assertEqual(result, 42) - self.assertEqual(future.result(), 42) - - def test_callback_positional(self): - # When the callback is passed in positionally, future_wrap shouldn't - # add another callback in the kwargs. - future = self.sync_future(self.stop) - result = self.wait() - self.assertEqual(result, 42) - self.assertEqual(future.result(), 42) - - def test_no_callback(self): - future = self.sync_future() - self.assertEqual(future.result(), 42) - - def test_none_callback_kw(self): - # explicitly pass None as callback - future = self.sync_future(callback=None) - self.assertEqual(future.result(), 42) - - def test_none_callback_pos(self): - future = self.sync_future(None) - self.assertEqual(future.result(), 42) - - def test_async_future(self): - future = self.async_future() - self.assertFalse(future.done()) - self.io_loop.add_future(future, self.stop) - future2 = self.wait() - self.assertIs(future, future2) - self.assertEqual(future.result(), 42) - - @gen_test - def test_async_future_gen(self): - result = yield self.async_future() - self.assertEqual(result, 42) - - def test_delayed_failure(self): - future = self.delayed_failure() - self.io_loop.add_future(future, self.stop) - future2 = self.wait() - self.assertIs(future, future2) - with self.assertRaises(ZeroDivisionError): - future.result() - - def test_kw_only_callback(self): - @return_future - def f(**kwargs): - kwargs['callback'](42) - future = f() - self.assertEqual(future.result(), 42) - - def test_error_in_callback(self): - self.sync_future(callback=lambda future: 1 / 0) - # The exception gets caught by our StackContext and will be re-raised - # when we wait. - self.assertRaises(ZeroDivisionError, self.wait) - - def test_no_result_future(self): - future = self.no_result_future(self.stop) - result = self.wait() - self.assertIs(result, None) - # result of this future is undefined, but not an error - future.result() - - def test_no_result_future_callback(self): - future = self.no_result_future(callback=lambda: self.stop()) - result = self.wait() - self.assertIs(result, None) - future.result() - - @gen_test - def test_future_traceback(self): - @return_future - @gen.engine - def f(callback): - yield gen.Task(self.io_loop.add_callback) - try: - 1 / 0 - except ZeroDivisionError: - self.expected_frame = traceback.extract_tb( - sys.exc_info()[2], limit=1)[0] - raise - try: - yield f() - self.fail("didn't get expected exception") - except ZeroDivisionError: - tb = traceback.extract_tb(sys.exc_info()[2]) - self.assertIn(self.expected_frame, tb) - -# The following series of classes demonstrate and test various styles -# of use, with and without generators and futures. - - -class CapServer(TCPServer): - def handle_stream(self, stream, address): - logging.info("handle_stream") - self.stream = stream - self.stream.read_until(b"\n", self.handle_read) - - def handle_read(self, data): - logging.info("handle_read") - data = to_unicode(data) - if data == data.upper(): - self.stream.write(b"error\talready capitalized\n") - else: - # data already has \n - self.stream.write(utf8("ok\t%s" % data.upper())) - self.stream.close() - - -class CapError(Exception): - pass - - -class BaseCapClient(object): - def __init__(self, port, io_loop): - self.port = port - self.io_loop = io_loop - - def process_response(self, data): - status, message = re.match('(.*)\t(.*)\n', to_unicode(data)).groups() - if status == 'ok': - return message - else: - raise CapError(message) - - -class ManualCapClient(BaseCapClient): - def capitalize(self, request_data, callback=None): - logging.info("capitalize") - self.request_data = request_data - self.stream = IOStream(socket.socket(), io_loop=self.io_loop) - self.stream.connect(('127.0.0.1', self.port), - callback=self.handle_connect) - self.future = Future() - if callback is not None: - self.future.add_done_callback( - stack_context.wrap(lambda future: callback(future.result()))) - return self.future - - def handle_connect(self): - logging.info("handle_connect") - self.stream.write(utf8(self.request_data + "\n")) - self.stream.read_until(b'\n', callback=self.handle_read) - - def handle_read(self, data): - logging.info("handle_read") - self.stream.close() - try: - self.future.set_result(self.process_response(data)) - except CapError as e: - self.future.set_exception(e) - - -class DecoratorCapClient(BaseCapClient): - @return_future - def capitalize(self, request_data, callback): - logging.info("capitalize") - self.request_data = request_data - self.stream = IOStream(socket.socket(), io_loop=self.io_loop) - self.stream.connect(('127.0.0.1', self.port), - callback=self.handle_connect) - self.callback = callback - - def handle_connect(self): - logging.info("handle_connect") - self.stream.write(utf8(self.request_data + "\n")) - self.stream.read_until(b'\n', callback=self.handle_read) - - def handle_read(self, data): - logging.info("handle_read") - self.stream.close() - self.callback(self.process_response(data)) - - -class GeneratorCapClient(BaseCapClient): - @return_future - @gen.engine - def capitalize(self, request_data, callback): - logging.info('capitalize') - stream = IOStream(socket.socket(), io_loop=self.io_loop) - logging.info('connecting') - yield gen.Task(stream.connect, ('127.0.0.1', self.port)) - stream.write(utf8(request_data + '\n')) - logging.info('reading') - data = yield gen.Task(stream.read_until, b'\n') - logging.info('returning') - stream.close() - callback(self.process_response(data)) - - -class ClientTestMixin(object): - def setUp(self): - super(ClientTestMixin, self).setUp() - self.server = CapServer(io_loop=self.io_loop) - sock, port = bind_unused_port() - self.server.add_sockets([sock]) - self.client = self.client_class(io_loop=self.io_loop, port=port) - - def tearDown(self): - self.server.stop() - super(ClientTestMixin, self).tearDown() - - def test_callback(self): - self.client.capitalize("hello", callback=self.stop) - result = self.wait() - self.assertEqual(result, "HELLO") - - def test_callback_error(self): - self.client.capitalize("HELLO", callback=self.stop) - self.assertRaisesRegexp(CapError, "already capitalized", self.wait) - - def test_future(self): - future = self.client.capitalize("hello") - self.io_loop.add_future(future, self.stop) - self.wait() - self.assertEqual(future.result(), "HELLO") - - def test_future_error(self): - future = self.client.capitalize("HELLO") - self.io_loop.add_future(future, self.stop) - self.wait() - self.assertRaisesRegexp(CapError, "already capitalized", future.result) - - def test_generator(self): - @gen.engine - def f(): - result = yield self.client.capitalize("hello") - self.assertEqual(result, "HELLO") - self.stop() - f() - self.wait() - - def test_generator_error(self): - @gen.engine - def f(): - with self.assertRaisesRegexp(CapError, "already capitalized"): - yield self.client.capitalize("HELLO") - self.stop() - f() - self.wait() - - -class ManualClientTest(ClientTestMixin, AsyncTestCase, LogTrapTestCase): - client_class = ManualCapClient - - -class DecoratorClientTest(ClientTestMixin, AsyncTestCase, LogTrapTestCase): - client_class = DecoratorCapClient - - -class GeneratorClientTest(ClientTestMixin, AsyncTestCase, LogTrapTestCase): - client_class = GeneratorCapClient - - -@unittest.skipIf(futures is None, "concurrent.futures module not present") -class RunOnExecutorTest(AsyncTestCase): - @gen_test - def test_no_calling(self): - class Object(object): - def __init__(self, io_loop): - self.io_loop = io_loop - self.executor = futures.thread.ThreadPoolExecutor(1) - - @run_on_executor - def f(self): - return 42 - - o = Object(io_loop=self.io_loop) - answer = yield o.f() - self.assertEqual(answer, 42) - - @gen_test - def test_call_with_no_args(self): - class Object(object): - def __init__(self, io_loop): - self.io_loop = io_loop - self.executor = futures.thread.ThreadPoolExecutor(1) - - @run_on_executor() - def f(self): - return 42 - - o = Object(io_loop=self.io_loop) - answer = yield o.f() - self.assertEqual(answer, 42) - - @gen_test - def test_call_with_io_loop(self): - class Object(object): - def __init__(self, io_loop): - self._io_loop = io_loop - self.executor = futures.thread.ThreadPoolExecutor(1) - - @run_on_executor(io_loop='_io_loop') - def f(self): - return 42 - - o = Object(io_loop=self.io_loop) - answer = yield o.f() - self.assertEqual(answer, 42) - - @gen_test - def test_call_with_executor(self): - class Object(object): - def __init__(self, io_loop): - self.io_loop = io_loop - self.__executor = futures.thread.ThreadPoolExecutor(1) - - @run_on_executor(executor='_Object__executor') - def f(self): - return 42 - - o = Object(io_loop=self.io_loop) - answer = yield o.f() - self.assertEqual(answer, 42) - - @gen_test - def test_call_with_both(self): - class Object(object): - def __init__(self, io_loop): - self._io_loop = io_loop - self.__executor = futures.thread.ThreadPoolExecutor(1) - - @run_on_executor(io_loop='_io_loop', executor='_Object__executor') - def f(self): - return 42 - - o = Object(io_loop=self.io_loop) - answer = yield o.f() - self.assertEqual(answer, 42) diff --git a/tornado/test/csv_translations/fr_FR.csv b/tornado/test/csv_translations/fr_FR.csv deleted file mode 100644 index 6321b6e7..00000000 --- a/tornado/test/csv_translations/fr_FR.csv +++ /dev/null @@ -1 +0,0 @@ -"school","école" diff --git a/tornado/test/curl_httpclient_test.py b/tornado/test/curl_httpclient_test.py deleted file mode 100644 index 3ac21f4d..00000000 --- a/tornado/test/curl_httpclient_test.py +++ /dev/null @@ -1,123 +0,0 @@ -from __future__ import absolute_import, division, print_function, with_statement - -from hashlib import md5 - -from tornado.escape import utf8 -from tornado.httpclient import HTTPRequest -from tornado.stack_context import ExceptionStackContext -from tornado.testing import AsyncHTTPTestCase -from tornado.test import httpclient_test -from tornado.test.util import unittest -from tornado.web import Application, RequestHandler - - -try: - import pycurl -except ImportError: - pycurl = None - -if pycurl is not None: - from tornado.curl_httpclient import CurlAsyncHTTPClient - - -@unittest.skipIf(pycurl is None, "pycurl module not present") -class CurlHTTPClientCommonTestCase(httpclient_test.HTTPClientCommonTestCase): - def get_http_client(self): - client = CurlAsyncHTTPClient(io_loop=self.io_loop, - defaults=dict(allow_ipv6=False)) - # make sure AsyncHTTPClient magic doesn't give us the wrong class - self.assertTrue(isinstance(client, CurlAsyncHTTPClient)) - return client - - -class DigestAuthHandler(RequestHandler): - def get(self): - realm = 'test' - opaque = 'asdf' - # Real implementations would use a random nonce. - nonce = "1234" - username = 'foo' - password = 'bar' - - auth_header = self.request.headers.get('Authorization', None) - if auth_header is not None: - auth_mode, params = auth_header.split(' ', 1) - assert auth_mode == 'Digest' - param_dict = {} - for pair in params.split(','): - k, v = pair.strip().split('=', 1) - if v[0] == '"' and v[-1] == '"': - v = v[1:-1] - param_dict[k] = v - assert param_dict['realm'] == realm - assert param_dict['opaque'] == opaque - assert param_dict['nonce'] == nonce - assert param_dict['username'] == username - assert param_dict['uri'] == self.request.path - h1 = md5(utf8('%s:%s:%s' % (username, realm, password))).hexdigest() - h2 = md5(utf8('%s:%s' % (self.request.method, - self.request.path))).hexdigest() - digest = md5(utf8('%s:%s:%s' % (h1, nonce, h2))).hexdigest() - if digest == param_dict['response']: - self.write('ok') - else: - self.write('fail') - else: - self.set_status(401) - self.set_header('WWW-Authenticate', - 'Digest realm="%s", nonce="%s", opaque="%s"' % - (realm, nonce, opaque)) - - -class CustomReasonHandler(RequestHandler): - def get(self): - self.set_status(200, "Custom reason") - - -class CustomFailReasonHandler(RequestHandler): - def get(self): - self.set_status(400, "Custom reason") - - -@unittest.skipIf(pycurl is None, "pycurl module not present") -class CurlHTTPClientTestCase(AsyncHTTPTestCase): - def setUp(self): - super(CurlHTTPClientTestCase, self).setUp() - self.http_client = CurlAsyncHTTPClient(self.io_loop, - defaults=dict(allow_ipv6=False)) - - def get_app(self): - return Application([ - ('/digest', DigestAuthHandler), - ('/custom_reason', CustomReasonHandler), - ('/custom_fail_reason', CustomFailReasonHandler), - ]) - - def test_prepare_curl_callback_stack_context(self): - exc_info = [] - - def error_handler(typ, value, tb): - exc_info.append((typ, value, tb)) - self.stop() - return True - - with ExceptionStackContext(error_handler): - request = HTTPRequest(self.get_url('/'), - prepare_curl_callback=lambda curl: 1 / 0) - self.http_client.fetch(request, callback=self.stop) - self.wait() - self.assertEqual(1, len(exc_info)) - self.assertIs(exc_info[0][0], ZeroDivisionError) - - def test_digest_auth(self): - response = self.fetch('/digest', auth_mode='digest', - auth_username='foo', auth_password='bar') - self.assertEqual(response.body, b'ok') - - def test_custom_reason(self): - response = self.fetch('/custom_reason') - self.assertEqual(response.reason, "Custom reason") - - def test_fail_custom_reason(self): - response = self.fetch('/custom_fail_reason') - self.assertEqual(str(response.error), "HTTP 400: Custom reason") diff --git a/tornado/test/escape_test.py b/tornado/test/escape_test.py deleted file mode 100644 index 98a23463..00000000 --- a/tornado/test/escape_test.py +++ /dev/null @@ -1,232 +0,0 @@ -#!/usr/bin/env python - - -from __future__ import absolute_import, division, print_function, with_statement -import tornado.escape - -from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode, squeeze, recursive_unicode -from tornado.util import u, unicode_type -from tornado.test.util import unittest - -linkify_tests = [ - # (input, linkify_kwargs, expected_output) - - ("hello http://world.com/!", {}, - u('hello http://world.com/!')), - - ("hello http://world.com/with?param=true&stuff=yes", {}, - u('hello http://world.com/with?param=true&stuff=yes')), - - # an opened paren followed by many chars killed Gruber's regex - ("http://url.com/w(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", {}, - u('http://url.com/w(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')), - - # as did too many dots at the end - ("http://url.com/withmany.......................................", {}, - u('http://url.com/withmany.......................................')), - - ("http://url.com/withmany((((((((((((((((((((((((((((((((((a)", {}, - u('http://url.com/withmany((((((((((((((((((((((((((((((((((a)')), - - # some examples from http://daringfireball.net/2009/11/liberal_regex_for_matching_urls - # plus a fex extras (such as multiple parentheses). - ("http://foo.com/blah_blah", {}, - u('http://foo.com/blah_blah')), - - ("http://foo.com/blah_blah/", {}, - u('http://foo.com/blah_blah/')), - - ("(Something like http://foo.com/blah_blah)", {}, - u('(Something like http://foo.com/blah_blah)')), - - ("http://foo.com/blah_blah_(wikipedia)", {}, - u('http://foo.com/blah_blah_(wikipedia)')), - - ("http://foo.com/blah_(blah)_(wikipedia)_blah", {}, - u('http://foo.com/blah_(blah)_(wikipedia)_blah')), - - ("(Something like http://foo.com/blah_blah_(wikipedia))", {}, - u('(Something like http://foo.com/blah_blah_(wikipedia))')), - - ("http://foo.com/blah_blah.", {}, - u('http://foo.com/blah_blah.')), - - ("http://foo.com/blah_blah/.", {}, - u('http://foo.com/blah_blah/.')), - - ("", {}, - u('<http://foo.com/blah_blah>')), - - ("", {}, - u('<http://foo.com/blah_blah/>')), - - ("http://foo.com/blah_blah,", {}, - u('http://foo.com/blah_blah,')), - - ("http://www.example.com/wpstyle/?p=364.", {}, - u('http://www.example.com/wpstyle/?p=364.')), - - ("rdar://1234", - {"permitted_protocols": ["http", "rdar"]}, - u('rdar://1234')), - - ("rdar:/1234", - {"permitted_protocols": ["rdar"]}, - u('rdar:/1234')), - - ("http://userid:password@example.com:8080", {}, - u('http://userid:password@example.com:8080')), - - ("http://userid@example.com", {}, - u('http://userid@example.com')), - - ("http://userid@example.com:8080", {}, - u('http://userid@example.com:8080')), - - ("http://userid:password@example.com", {}, - u('http://userid:password@example.com')), - - ("message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e", - {"permitted_protocols": ["http", "message"]}, - u('message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e')), - - (u("http://\u27a1.ws/\u4a39"), {}, - u('http://\u27a1.ws/\u4a39')), - - ("http://example.com", {}, - u('<tag>http://example.com</tag>')), - - ("Just a www.example.com link.", {}, - u('Just a www.example.com link.')), - - ("Just a www.example.com link.", - {"require_protocol": True}, - u('Just a www.example.com link.')), - - ("A http://reallylong.com/link/that/exceedsthelenglimit.html", - {"require_protocol": True, "shorten": True}, - u('A http://reallylong.com/link...')), - - ("A http://reallylongdomainnamethatwillbetoolong.com/hi!", - {"shorten": True}, - u('A http://reallylongdomainnametha...!')), - - ("A file:///passwords.txt and http://web.com link", {}, - u('A file:///passwords.txt and http://web.com link')), - - ("A file:///passwords.txt and http://web.com link", - {"permitted_protocols": ["file"]}, - u('A file:///passwords.txt and http://web.com link')), - - ("www.external-link.com", - {"extra_params": 'rel="nofollow" class="external"'}, - u('www.external-link.com')), - - ("www.external-link.com and www.internal-link.com/blogs extra", - {"extra_params": lambda href: 'class="internal"' if href.startswith("http://www.internal-link.com") else 'rel="nofollow" class="external"'}, - u('www.external-link.com and www.internal-link.com/blogs extra')), - - ("www.external-link.com", - {"extra_params": lambda href: ' rel="nofollow" class="external" '}, - u('www.external-link.com')), -] - - -class EscapeTestCase(unittest.TestCase): - def test_linkify(self): - for text, kwargs, html in linkify_tests: - linked = tornado.escape.linkify(text, **kwargs) - self.assertEqual(linked, html) - - def test_xhtml_escape(self): - tests = [ - ("", "<foo>"), - (u(""), u("<foo>")), - (b"", b"<foo>"), - - ("<>&\"'", "<>&"'"), - ("&", "&amp;"), - - (u("<\u00e9>"), u("<\u00e9>")), - (b"<\xc3\xa9>", b"<\xc3\xa9>"), - ] - for unescaped, escaped in tests: - self.assertEqual(utf8(xhtml_escape(unescaped)), utf8(escaped)) - self.assertEqual(utf8(unescaped), utf8(xhtml_unescape(escaped))) - - def test_url_escape_unicode(self): - tests = [ - # byte strings are passed through as-is - (u('\u00e9').encode('utf8'), '%C3%A9'), - (u('\u00e9').encode('latin1'), '%E9'), - - # unicode strings become utf8 - (u('\u00e9'), '%C3%A9'), - ] - for unescaped, escaped in tests: - self.assertEqual(url_escape(unescaped), escaped) - - def test_url_unescape_unicode(self): - tests = [ - ('%C3%A9', u('\u00e9'), 'utf8'), - ('%C3%A9', u('\u00c3\u00a9'), 'latin1'), - ('%C3%A9', utf8(u('\u00e9')), None), - ] - for escaped, unescaped, encoding in tests: - # input strings to url_unescape should only contain ascii - # characters, but make sure the function accepts both byte - # and unicode strings. - self.assertEqual(url_unescape(to_unicode(escaped), encoding), unescaped) - self.assertEqual(url_unescape(utf8(escaped), encoding), unescaped) - - def test_url_escape_quote_plus(self): - unescaped = '+ #%' - plus_escaped = '%2B+%23%25' - escaped = '%2B%20%23%25' - self.assertEqual(url_escape(unescaped), plus_escaped) - self.assertEqual(url_escape(unescaped, plus=False), escaped) - self.assertEqual(url_unescape(plus_escaped), unescaped) - self.assertEqual(url_unescape(escaped, plus=False), unescaped) - self.assertEqual(url_unescape(plus_escaped, encoding=None), - utf8(unescaped)) - self.assertEqual(url_unescape(escaped, encoding=None, plus=False), - utf8(unescaped)) - - def test_escape_return_types(self): - # On python2 the escape methods should generally return the same - # type as their argument - self.assertEqual(type(xhtml_escape("foo")), str) - self.assertEqual(type(xhtml_escape(u("foo"))), unicode_type) - - def test_json_decode(self): - # json_decode accepts both bytes and unicode, but strings it returns - # are always unicode. - self.assertEqual(json_decode(b'"foo"'), u("foo")) - self.assertEqual(json_decode(u('"foo"')), u("foo")) - - # Non-ascii bytes are interpreted as utf8 - self.assertEqual(json_decode(utf8(u('"\u00e9"'))), u("\u00e9")) - - def test_json_encode(self): - # json deals with strings, not bytes. On python 2 byte strings will - # convert automatically if they are utf8; on python 3 byte strings - # are not allowed. - self.assertEqual(json_decode(json_encode(u("\u00e9"))), u("\u00e9")) - if bytes is str: - self.assertEqual(json_decode(json_encode(utf8(u("\u00e9")))), u("\u00e9")) - self.assertRaises(UnicodeDecodeError, json_encode, b"\xe9") - - def test_squeeze(self): - self.assertEqual(squeeze(u('sequences of whitespace chars')), u('sequences of whitespace chars')) - - def test_recursive_unicode(self): - tests = { - 'dict': {b"foo": b"bar"}, - 'list': [b"foo", b"bar"], - 'tuple': (b"foo", b"bar"), - 'bytes': b"foo" - } - self.assertEqual(recursive_unicode(tests['dict']), {u("foo"): u("bar")}) - self.assertEqual(recursive_unicode(tests['list']), [u("foo"), u("bar")]) - self.assertEqual(recursive_unicode(tests['tuple']), (u("foo"), u("bar"))) - self.assertEqual(recursive_unicode(tests['bytes']), u("foo")) diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py deleted file mode 100644 index fdaa0ec8..00000000 --- a/tornado/test/gen_test.py +++ /dev/null @@ -1,1263 +0,0 @@ -from __future__ import absolute_import, division, print_function, with_statement - -import contextlib -import datetime -import functools -import sys -import textwrap -import time -import platform -import weakref - -from tornado.concurrent import return_future, Future -from tornado.escape import url_escape -from tornado.httpclient import AsyncHTTPClient -from tornado.ioloop import IOLoop -from tornado.log import app_log -from tornado import stack_context -from tornado.testing import AsyncHTTPTestCase, AsyncTestCase, ExpectLog, gen_test -from tornado.test.util import unittest, skipOnTravis -from tornado.web import Application, RequestHandler, asynchronous, HTTPError - -from tornado import gen - -try: - from concurrent import futures -except ImportError: - futures = None - -skipBefore33 = unittest.skipIf(sys.version_info < (3, 3), 'PEP 380 not available') -skipNotCPython = unittest.skipIf(platform.python_implementation() != 'CPython', - 'Not CPython implementation') - - -class GenEngineTest(AsyncTestCase): - def setUp(self): - super(GenEngineTest, self).setUp() - self.named_contexts = [] - - def named_context(self, name): - @contextlib.contextmanager - def context(): - self.named_contexts.append(name) - try: - yield - finally: - self.assertEqual(self.named_contexts.pop(), name) - return context - - def run_gen(self, f): - f() - return self.wait() - - def delay_callback(self, iterations, callback, arg): - """Runs callback(arg) after a number of IOLoop iterations.""" - if iterations == 0: - callback(arg) - else: - self.io_loop.add_callback(functools.partial( - self.delay_callback, iterations - 1, callback, arg)) - - @return_future - def async_future(self, result, callback): - self.io_loop.add_callback(callback, result) - - @gen.coroutine - def async_exception(self, e): - yield gen.moment - raise e - - def test_no_yield(self): - @gen.engine - def f(): - self.stop() - self.run_gen(f) - - def test_inline_cb(self): - @gen.engine - def f(): - (yield gen.Callback("k1"))() - res = yield gen.Wait("k1") - self.assertTrue(res is None) - self.stop() - self.run_gen(f) - - def test_ioloop_cb(self): - @gen.engine - def f(): - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - self.stop() - self.run_gen(f) - - def test_exception_phase1(self): - @gen.engine - def f(): - 1 / 0 - self.assertRaises(ZeroDivisionError, self.run_gen, f) - - def test_exception_phase2(self): - @gen.engine - def f(): - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - 1 / 0 - self.assertRaises(ZeroDivisionError, self.run_gen, f) - - def test_exception_in_task_phase1(self): - def fail_task(callback): - 1 / 0 - - @gen.engine - def f(): - try: - yield gen.Task(fail_task) - raise Exception("did not get expected exception") - except ZeroDivisionError: - self.stop() - self.run_gen(f) - - def test_exception_in_task_phase2(self): - # This is the case that requires the use of stack_context in gen.engine - def fail_task(callback): - self.io_loop.add_callback(lambda: 1 / 0) - - @gen.engine - def f(): - try: - yield gen.Task(fail_task) - raise Exception("did not get expected exception") - except ZeroDivisionError: - self.stop() - self.run_gen(f) - - def test_with_arg(self): - @gen.engine - def f(): - (yield gen.Callback("k1"))(42) - res = yield gen.Wait("k1") - self.assertEqual(42, res) - self.stop() - self.run_gen(f) - - def test_with_arg_tuple(self): - @gen.engine - def f(): - (yield gen.Callback((1, 2)))((3, 4)) - res = yield gen.Wait((1, 2)) - self.assertEqual((3, 4), res) - self.stop() - self.run_gen(f) - - def test_key_reuse(self): - @gen.engine - def f(): - yield gen.Callback("k1") - yield gen.Callback("k1") - self.stop() - self.assertRaises(gen.KeyReuseError, self.run_gen, f) - - def test_key_reuse_tuple(self): - @gen.engine - def f(): - yield gen.Callback((1, 2)) - yield gen.Callback((1, 2)) - self.stop() - self.assertRaises(gen.KeyReuseError, self.run_gen, f) - - def test_key_mismatch(self): - @gen.engine - def f(): - yield gen.Callback("k1") - yield gen.Wait("k2") - self.stop() - self.assertRaises(gen.UnknownKeyError, self.run_gen, f) - - def test_key_mismatch_tuple(self): - @gen.engine - def f(): - yield gen.Callback((1, 2)) - yield gen.Wait((2, 3)) - self.stop() - self.assertRaises(gen.UnknownKeyError, self.run_gen, f) - - def test_leaked_callback(self): - @gen.engine - def f(): - yield gen.Callback("k1") - self.stop() - self.assertRaises(gen.LeakedCallbackError, self.run_gen, f) - - def test_leaked_callback_tuple(self): - @gen.engine - def f(): - yield gen.Callback((1, 2)) - self.stop() - self.assertRaises(gen.LeakedCallbackError, self.run_gen, f) - - def test_parallel_callback(self): - @gen.engine - def f(): - for k in range(3): - self.io_loop.add_callback((yield gen.Callback(k))) - yield gen.Wait(1) - self.io_loop.add_callback((yield gen.Callback(3))) - yield gen.Wait(0) - yield gen.Wait(3) - yield gen.Wait(2) - self.stop() - self.run_gen(f) - - def test_bogus_yield(self): - @gen.engine - def f(): - yield 42 - self.assertRaises(gen.BadYieldError, self.run_gen, f) - - def test_bogus_yield_tuple(self): - @gen.engine - def f(): - yield (1, 2) - self.assertRaises(gen.BadYieldError, self.run_gen, f) - - def test_reuse(self): - @gen.engine - def f(): - self.io_loop.add_callback((yield gen.Callback(0))) - yield gen.Wait(0) - self.stop() - self.run_gen(f) - self.run_gen(f) - - def test_task(self): - @gen.engine - def f(): - yield gen.Task(self.io_loop.add_callback) - self.stop() - self.run_gen(f) - - def test_wait_all(self): - @gen.engine - def f(): - (yield gen.Callback("k1"))("v1") - (yield gen.Callback("k2"))("v2") - results = yield gen.WaitAll(["k1", "k2"]) - self.assertEqual(results, ["v1", "v2"]) - self.stop() - self.run_gen(f) - - def test_exception_in_yield(self): - @gen.engine - def f(): - try: - yield gen.Wait("k1") - raise Exception("did not get expected exception") - except gen.UnknownKeyError: - pass - self.stop() - self.run_gen(f) - - def test_resume_after_exception_in_yield(self): - @gen.engine - def f(): - try: - yield gen.Wait("k1") - raise Exception("did not get expected exception") - except gen.UnknownKeyError: - pass - (yield gen.Callback("k2"))("v2") - self.assertEqual((yield gen.Wait("k2")), "v2") - self.stop() - self.run_gen(f) - - def test_orphaned_callback(self): - @gen.engine - def f(): - self.orphaned_callback = yield gen.Callback(1) - try: - self.run_gen(f) - raise Exception("did not get expected exception") - except gen.LeakedCallbackError: - pass - self.orphaned_callback() - - def test_multi(self): - @gen.engine - def f(): - (yield gen.Callback("k1"))("v1") - (yield gen.Callback("k2"))("v2") - results = yield [gen.Wait("k1"), gen.Wait("k2")] - self.assertEqual(results, ["v1", "v2"]) - self.stop() - self.run_gen(f) - - def test_multi_dict(self): - @gen.engine - def f(): - (yield gen.Callback("k1"))("v1") - (yield gen.Callback("k2"))("v2") - results = yield dict(foo=gen.Wait("k1"), bar=gen.Wait("k2")) - self.assertEqual(results, dict(foo="v1", bar="v2")) - self.stop() - self.run_gen(f) - - # The following tests explicitly run with both gen.Multi - # and gen.multi_future (Task returns a Future, so it can be used - # with either). - def test_multi_yieldpoint_delayed(self): - @gen.engine - def f(): - # callbacks run at different times - responses = yield gen.Multi([ - gen.Task(self.delay_callback, 3, arg="v1"), - gen.Task(self.delay_callback, 1, arg="v2"), - ]) - self.assertEqual(responses, ["v1", "v2"]) - self.stop() - self.run_gen(f) - - def test_multi_yieldpoint_dict_delayed(self): - @gen.engine - def f(): - # callbacks run at different times - responses = yield gen.Multi(dict( - foo=gen.Task(self.delay_callback, 3, arg="v1"), - bar=gen.Task(self.delay_callback, 1, arg="v2"), - )) - self.assertEqual(responses, dict(foo="v1", bar="v2")) - self.stop() - self.run_gen(f) - - def test_multi_future_delayed(self): - @gen.engine - def f(): - # callbacks run at different times - responses = yield gen.multi_future([ - gen.Task(self.delay_callback, 3, arg="v1"), - gen.Task(self.delay_callback, 1, arg="v2"), - ]) - self.assertEqual(responses, ["v1", "v2"]) - self.stop() - self.run_gen(f) - - def test_multi_future_dict_delayed(self): - @gen.engine - def f(): - # callbacks run at different times - responses = yield gen.multi_future(dict( - foo=gen.Task(self.delay_callback, 3, arg="v1"), - bar=gen.Task(self.delay_callback, 1, arg="v2"), - )) - self.assertEqual(responses, dict(foo="v1", bar="v2")) - self.stop() - self.run_gen(f) - - @skipOnTravis - @gen_test - def test_multi_performance(self): - # Yielding a list used to have quadratic performance; make - # sure a large list stays reasonable. On my laptop a list of - # 2000 used to take 1.8s, now it takes 0.12. - start = time.time() - yield [gen.Task(self.io_loop.add_callback) for i in range(2000)] - end = time.time() - self.assertLess(end - start, 1.0) - - @gen_test - def test_multi_empty(self): - # Empty lists or dicts should return the same type. - x = yield [] - self.assertTrue(isinstance(x, list)) - y = yield {} - self.assertTrue(isinstance(y, dict)) - - @gen_test - def test_multi_mixed_types(self): - # A YieldPoint (Wait) and Future (Task) can be combined - # (and use the YieldPoint codepath) - (yield gen.Callback("k1"))("v1") - responses = yield [gen.Wait("k1"), - gen.Task(self.delay_callback, 3, arg="v2")] - self.assertEqual(responses, ["v1", "v2"]) - - @gen_test - def test_future(self): - result = yield self.async_future(1) - self.assertEqual(result, 1) - - @gen_test - def test_multi_future(self): - results = yield [self.async_future(1), self.async_future(2)] - self.assertEqual(results, [1, 2]) - - @gen_test - def test_multi_future_duplicate(self): - f = self.async_future(2) - results = yield [self.async_future(1), f, self.async_future(3), f] - self.assertEqual(results, [1, 2, 3, 2]) - - @gen_test - def test_multi_dict_future(self): - results = yield dict(foo=self.async_future(1), bar=self.async_future(2)) - self.assertEqual(results, dict(foo=1, bar=2)) - - @gen_test - def test_multi_exceptions(self): - with ExpectLog(app_log, "Multiple exceptions in yield list"): - with self.assertRaises(RuntimeError) as cm: - yield gen.Multi([self.async_exception(RuntimeError("error 1")), - self.async_exception(RuntimeError("error 2"))]) - self.assertEqual(str(cm.exception), "error 1") - - # With only one exception, no error is logged. - with self.assertRaises(RuntimeError): - yield gen.Multi([self.async_exception(RuntimeError("error 1")), - self.async_future(2)]) - - # Exception logging may be explicitly quieted. - with self.assertRaises(RuntimeError): - yield gen.Multi([self.async_exception(RuntimeError("error 1")), - self.async_exception(RuntimeError("error 2"))], - quiet_exceptions=RuntimeError) - - @gen_test - def test_multi_future_exceptions(self): - with ExpectLog(app_log, "Multiple exceptions in yield list"): - with self.assertRaises(RuntimeError) as cm: - yield [self.async_exception(RuntimeError("error 1")), - self.async_exception(RuntimeError("error 2"))] - self.assertEqual(str(cm.exception), "error 1") - - # With only one exception, no error is logged. - with self.assertRaises(RuntimeError): - yield [self.async_exception(RuntimeError("error 1")), - self.async_future(2)] - - # Exception logging may be explicitly quieted. - with self.assertRaises(RuntimeError): - yield gen.multi_future( - [self.async_exception(RuntimeError("error 1")), - self.async_exception(RuntimeError("error 2"))], - quiet_exceptions=RuntimeError) - - def test_arguments(self): - @gen.engine - def f(): - (yield gen.Callback("noargs"))() - self.assertEqual((yield gen.Wait("noargs")), None) - (yield gen.Callback("1arg"))(42) - self.assertEqual((yield gen.Wait("1arg")), 42) - - (yield gen.Callback("kwargs"))(value=42) - result = yield gen.Wait("kwargs") - self.assertTrue(isinstance(result, gen.Arguments)) - self.assertEqual(((), dict(value=42)), result) - self.assertEqual(dict(value=42), result.kwargs) - - (yield gen.Callback("2args"))(42, 43) - result = yield gen.Wait("2args") - self.assertTrue(isinstance(result, gen.Arguments)) - self.assertEqual(((42, 43), {}), result) - self.assertEqual((42, 43), result.args) - - def task_func(callback): - callback(None, error="foo") - result = yield gen.Task(task_func) - self.assertTrue(isinstance(result, gen.Arguments)) - self.assertEqual(((None,), dict(error="foo")), result) - - self.stop() - self.run_gen(f) - - def test_stack_context_leak(self): - # regression test: repeated invocations of a gen-based - # function should not result in accumulated stack_contexts - def _stack_depth(): - head = stack_context._state.contexts[1] - length = 0 - - while head is not None: - length += 1 - head = head.old_contexts[1] - - return length - - @gen.engine - def inner(callback): - yield gen.Task(self.io_loop.add_callback) - callback() - - @gen.engine - def outer(): - for i in range(10): - yield gen.Task(inner) - - stack_increase = _stack_depth() - initial_stack_depth - self.assertTrue(stack_increase <= 2) - self.stop() - initial_stack_depth = _stack_depth() - self.run_gen(outer) - - def test_stack_context_leak_exception(self): - # same as previous, but with a function that exits with an exception - @gen.engine - def inner(callback): - yield gen.Task(self.io_loop.add_callback) - 1 / 0 - - @gen.engine - def outer(): - for i in range(10): - try: - yield gen.Task(inner) - except ZeroDivisionError: - pass - stack_increase = len(stack_context._state.contexts) - initial_stack_depth - self.assertTrue(stack_increase <= 2) - self.stop() - initial_stack_depth = len(stack_context._state.contexts) - self.run_gen(outer) - - def function_with_stack_context(self, callback): - # Technically this function should stack_context.wrap its callback - # upon entry. However, it is very common for this step to be - # omitted. - def step2(): - self.assertEqual(self.named_contexts, ['a']) - self.io_loop.add_callback(callback) - - with stack_context.StackContext(self.named_context('a')): - self.io_loop.add_callback(step2) - - @gen_test - def test_wait_transfer_stack_context(self): - # Wait should not pick up contexts from where callback was invoked, - # even if that function improperly fails to wrap its callback. - cb = yield gen.Callback('k1') - self.function_with_stack_context(cb) - self.assertEqual(self.named_contexts, []) - yield gen.Wait('k1') - self.assertEqual(self.named_contexts, []) - - @gen_test - def test_task_transfer_stack_context(self): - yield gen.Task(self.function_with_stack_context) - self.assertEqual(self.named_contexts, []) - - def test_raise_after_stop(self): - # This pattern will be used in the following tests so make sure - # the exception propagates as expected. - @gen.engine - def f(): - self.stop() - 1 / 0 - - with self.assertRaises(ZeroDivisionError): - self.run_gen(f) - - def test_sync_raise_return(self): - # gen.Return is allowed in @gen.engine, but it may not be used - # to return a value. - @gen.engine - def f(): - self.stop(42) - raise gen.Return() - - result = self.run_gen(f) - self.assertEqual(result, 42) - - def test_async_raise_return(self): - @gen.engine - def f(): - yield gen.Task(self.io_loop.add_callback) - self.stop(42) - raise gen.Return() - - result = self.run_gen(f) - self.assertEqual(result, 42) - - def test_sync_raise_return_value(self): - @gen.engine - def f(): - raise gen.Return(42) - - with self.assertRaises(gen.ReturnValueIgnoredError): - self.run_gen(f) - - def test_sync_raise_return_value_tuple(self): - @gen.engine - def f(): - raise gen.Return((1, 2)) - - with self.assertRaises(gen.ReturnValueIgnoredError): - self.run_gen(f) - - def test_async_raise_return_value(self): - @gen.engine - def f(): - yield gen.Task(self.io_loop.add_callback) - raise gen.Return(42) - - with self.assertRaises(gen.ReturnValueIgnoredError): - self.run_gen(f) - - def test_async_raise_return_value_tuple(self): - @gen.engine - def f(): - yield gen.Task(self.io_loop.add_callback) - raise gen.Return((1, 2)) - - with self.assertRaises(gen.ReturnValueIgnoredError): - self.run_gen(f) - - def test_return_value(self): - # It is an error to apply @gen.engine to a function that returns - # a value. - @gen.engine - def f(): - return 42 - - with self.assertRaises(gen.ReturnValueIgnoredError): - self.run_gen(f) - - def test_return_value_tuple(self): - # It is an error to apply @gen.engine to a function that returns - # a value. - @gen.engine - def f(): - return (1, 2) - - with self.assertRaises(gen.ReturnValueIgnoredError): - self.run_gen(f) - - @skipNotCPython - def test_task_refcounting(self): - # On CPython, tasks and their arguments should be released immediately - # without waiting for garbage collection. - @gen.engine - def f(): - class Foo(object): - pass - arg = Foo() - self.arg_ref = weakref.ref(arg) - task = gen.Task(self.io_loop.add_callback, arg=arg) - self.task_ref = weakref.ref(task) - yield task - self.stop() - - self.run_gen(f) - self.assertIs(self.arg_ref(), None) - self.assertIs(self.task_ref(), None) - - -class GenCoroutineTest(AsyncTestCase): - def setUp(self): - # Stray StopIteration exceptions can lead to tests exiting prematurely, - # so we need explicit checks here to make sure the tests run all - # the way through. - self.finished = False - super(GenCoroutineTest, self).setUp() - - def tearDown(self): - super(GenCoroutineTest, self).tearDown() - assert self.finished - - @gen_test - def test_sync_gen_return(self): - @gen.coroutine - def f(): - raise gen.Return(42) - result = yield f() - self.assertEqual(result, 42) - self.finished = True - - @gen_test - def test_async_gen_return(self): - @gen.coroutine - def f(): - yield gen.Task(self.io_loop.add_callback) - raise gen.Return(42) - result = yield f() - self.assertEqual(result, 42) - self.finished = True - - @gen_test - def test_sync_return(self): - @gen.coroutine - def f(): - return 42 - result = yield f() - self.assertEqual(result, 42) - self.finished = True - - @skipBefore33 - @gen_test - def test_async_return(self): - # It is a compile-time error to return a value in a generator - # before Python 3.3, so we must test this with exec. - # Flatten the real global and local namespace into our fake globals: - # it's all global from the perspective of f(). - global_namespace = dict(globals(), **locals()) - local_namespace = {} - exec(textwrap.dedent(""" - @gen.coroutine - def f(): - yield gen.Task(self.io_loop.add_callback) - return 42 - """), global_namespace, local_namespace) - result = yield local_namespace['f']() - self.assertEqual(result, 42) - self.finished = True - - @skipBefore33 - @gen_test - def test_async_early_return(self): - # A yield statement exists but is not executed, which means - # this function "returns" via an exception. This exception - # doesn't happen before the exception handling is set up. - global_namespace = dict(globals(), **locals()) - local_namespace = {} - exec(textwrap.dedent(""" - @gen.coroutine - def f(): - if True: - return 42 - yield gen.Task(self.io_loop.add_callback) - """), global_namespace, local_namespace) - result = yield local_namespace['f']() - self.assertEqual(result, 42) - self.finished = True - - @gen_test - def test_sync_return_no_value(self): - @gen.coroutine - def f(): - return - result = yield f() - self.assertEqual(result, None) - self.finished = True - - @gen_test - def test_async_return_no_value(self): - # Without a return value we don't need python 3.3. - @gen.coroutine - def f(): - yield gen.Task(self.io_loop.add_callback) - return - result = yield f() - self.assertEqual(result, None) - self.finished = True - - @gen_test - def test_sync_raise(self): - @gen.coroutine - def f(): - 1 / 0 - # The exception is raised when the future is yielded - # (or equivalently when its result method is called), - # not when the function itself is called). - future = f() - with self.assertRaises(ZeroDivisionError): - yield future - self.finished = True - - @gen_test - def test_async_raise(self): - @gen.coroutine - def f(): - yield gen.Task(self.io_loop.add_callback) - 1 / 0 - future = f() - with self.assertRaises(ZeroDivisionError): - yield future - self.finished = True - - @gen_test - def test_pass_callback(self): - @gen.coroutine - def f(): - raise gen.Return(42) - result = yield gen.Task(f) - self.assertEqual(result, 42) - self.finished = True - - @gen_test - def test_replace_yieldpoint_exception(self): - # Test exception handling: a coroutine can catch one exception - # raised by a yield point and raise a different one. - @gen.coroutine - def f1(): - 1 / 0 - - @gen.coroutine - def f2(): - try: - yield f1() - except ZeroDivisionError: - raise KeyError() - - future = f2() - with self.assertRaises(KeyError): - yield future - self.finished = True - - @gen_test - def test_swallow_yieldpoint_exception(self): - # Test exception handling: a coroutine can catch an exception - # raised by a yield point and not raise a different one. - @gen.coroutine - def f1(): - 1 / 0 - - @gen.coroutine - def f2(): - try: - yield f1() - except ZeroDivisionError: - raise gen.Return(42) - - result = yield f2() - self.assertEqual(result, 42) - self.finished = True - - @gen_test - def test_replace_context_exception(self): - # Test exception handling: exceptions thrown into the stack context - # can be caught and replaced. - # Note that this test and the following are for behavior that is - # not really supported any more: coroutines no longer create a - # stack context automatically; but one is created after the first - # YieldPoint (i.e. not a Future). - @gen.coroutine - def f2(): - (yield gen.Callback(1))() - yield gen.Wait(1) - self.io_loop.add_callback(lambda: 1 / 0) - try: - yield gen.Task(self.io_loop.add_timeout, - self.io_loop.time() + 10) - except ZeroDivisionError: - raise KeyError() - - future = f2() - with self.assertRaises(KeyError): - yield future - self.finished = True - - @gen_test - def test_swallow_context_exception(self): - # Test exception handling: exceptions thrown into the stack context - # can be caught and ignored. - @gen.coroutine - def f2(): - (yield gen.Callback(1))() - yield gen.Wait(1) - self.io_loop.add_callback(lambda: 1 / 0) - try: - yield gen.Task(self.io_loop.add_timeout, - self.io_loop.time() + 10) - except ZeroDivisionError: - raise gen.Return(42) - - result = yield f2() - self.assertEqual(result, 42) - self.finished = True - - @gen_test - def test_moment(self): - calls = [] - - @gen.coroutine - def f(name, yieldable): - for i in range(5): - calls.append(name) - yield yieldable - # First, confirm the behavior without moment: each coroutine - # monopolizes the event loop until it finishes. - immediate = Future() - immediate.set_result(None) - yield [f('a', immediate), f('b', immediate)] - self.assertEqual(''.join(calls), 'aaaaabbbbb') - - # With moment, they take turns. - calls = [] - yield [f('a', gen.moment), f('b', gen.moment)] - self.assertEqual(''.join(calls), 'ababababab') - self.finished = True - - calls = [] - yield [f('a', gen.moment), f('b', immediate)] - self.assertEqual(''.join(calls), 'abbbbbaaaa') - - @gen_test - def test_sleep(self): - yield gen.sleep(0.01) - self.finished = True - - @skipBefore33 - @gen_test - def test_py3_leak_exception_context(self): - class LeakedException(Exception): - pass - - @gen.coroutine - def inner(iteration): - raise LeakedException(iteration) - - try: - yield inner(1) - except LeakedException as e: - self.assertEqual(str(e), "1") - self.assertIsNone(e.__context__) - - try: - yield inner(2) - except LeakedException as e: - self.assertEqual(str(e), "2") - self.assertIsNone(e.__context__) - - self.finished = True - -class GenSequenceHandler(RequestHandler): - @asynchronous - @gen.engine - def get(self): - self.io_loop = self.request.connection.stream.io_loop - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - self.write("1") - self.io_loop.add_callback((yield gen.Callback("k2"))) - yield gen.Wait("k2") - self.write("2") - # reuse an old key - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - self.finish("3") - - -class GenCoroutineSequenceHandler(RequestHandler): - @gen.coroutine - def get(self): - self.io_loop = self.request.connection.stream.io_loop - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - self.write("1") - self.io_loop.add_callback((yield gen.Callback("k2"))) - yield gen.Wait("k2") - self.write("2") - # reuse an old key - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - self.finish("3") - - -class GenCoroutineUnfinishedSequenceHandler(RequestHandler): - @asynchronous - @gen.coroutine - def get(self): - self.io_loop = self.request.connection.stream.io_loop - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - self.write("1") - self.io_loop.add_callback((yield gen.Callback("k2"))) - yield gen.Wait("k2") - self.write("2") - # reuse an old key - self.io_loop.add_callback((yield gen.Callback("k1"))) - yield gen.Wait("k1") - # just write, don't finish - self.write("3") - - -class GenTaskHandler(RequestHandler): - @asynchronous - @gen.engine - def get(self): - io_loop = self.request.connection.stream.io_loop - client = AsyncHTTPClient(io_loop=io_loop) - response = yield gen.Task(client.fetch, self.get_argument('url')) - response.rethrow() - self.finish(b"got response: " + response.body) - - -class GenExceptionHandler(RequestHandler): - @asynchronous - @gen.engine - def get(self): - # This test depends on the order of the two decorators. - io_loop = self.request.connection.stream.io_loop - yield gen.Task(io_loop.add_callback) - raise Exception("oops") - - -class GenCoroutineExceptionHandler(RequestHandler): - @gen.coroutine - def get(self): - # This test depends on the order of the two decorators. - io_loop = self.request.connection.stream.io_loop - yield gen.Task(io_loop.add_callback) - raise Exception("oops") - - -class GenYieldExceptionHandler(RequestHandler): - @asynchronous - @gen.engine - def get(self): - io_loop = self.request.connection.stream.io_loop - # Test the interaction of the two stack_contexts. - - def fail_task(callback): - io_loop.add_callback(lambda: 1 / 0) - try: - yield gen.Task(fail_task) - raise Exception("did not get expected exception") - except ZeroDivisionError: - self.finish('ok') - - -class UndecoratedCoroutinesHandler(RequestHandler): - @gen.coroutine - def prepare(self): - self.chunks = [] - yield gen.Task(IOLoop.current().add_callback) - self.chunks.append('1') - - @gen.coroutine - def get(self): - self.chunks.append('2') - yield gen.Task(IOLoop.current().add_callback) - self.chunks.append('3') - yield gen.Task(IOLoop.current().add_callback) - self.write(''.join(self.chunks)) - - -class AsyncPrepareErrorHandler(RequestHandler): - @gen.coroutine - def prepare(self): - yield gen.Task(IOLoop.current().add_callback) - raise HTTPError(403) - - def get(self): - self.finish('ok') - - -class GenWebTest(AsyncHTTPTestCase): - def get_app(self): - return Application([ - ('/sequence', GenSequenceHandler), - ('/coroutine_sequence', GenCoroutineSequenceHandler), - ('/coroutine_unfinished_sequence', - GenCoroutineUnfinishedSequenceHandler), - ('/task', GenTaskHandler), - ('/exception', GenExceptionHandler), - ('/coroutine_exception', GenCoroutineExceptionHandler), - ('/yield_exception', GenYieldExceptionHandler), - ('/undecorated_coroutine', UndecoratedCoroutinesHandler), - ('/async_prepare_error', AsyncPrepareErrorHandler), - ]) - - def test_sequence_handler(self): - response = self.fetch('/sequence') - self.assertEqual(response.body, b"123") - - def test_coroutine_sequence_handler(self): - response = self.fetch('/coroutine_sequence') - self.assertEqual(response.body, b"123") - - def test_coroutine_unfinished_sequence_handler(self): - response = self.fetch('/coroutine_unfinished_sequence') - self.assertEqual(response.body, b"123") - - def test_task_handler(self): - response = self.fetch('/task?url=%s' % url_escape(self.get_url('/sequence'))) - self.assertEqual(response.body, b"got response: 123") - - def test_exception_handler(self): - # Make sure we get an error and not a timeout - with ExpectLog(app_log, "Uncaught exception GET /exception"): - response = self.fetch('/exception') - self.assertEqual(500, response.code) - - def test_coroutine_exception_handler(self): - # Make sure we get an error and not a timeout - with ExpectLog(app_log, "Uncaught exception GET /coroutine_exception"): - response = self.fetch('/coroutine_exception') - self.assertEqual(500, response.code) - - def test_yield_exception_handler(self): - response = self.fetch('/yield_exception') - self.assertEqual(response.body, b'ok') - - def test_undecorated_coroutines(self): - response = self.fetch('/undecorated_coroutine') - self.assertEqual(response.body, b'123') - - def test_async_prepare_error_handler(self): - response = self.fetch('/async_prepare_error') - self.assertEqual(response.code, 403) - - -class WithTimeoutTest(AsyncTestCase): - @gen_test - def test_timeout(self): - with self.assertRaises(gen.TimeoutError): - yield gen.with_timeout(datetime.timedelta(seconds=0.1), - Future()) - - @gen_test - def test_completes_before_timeout(self): - future = Future() - self.io_loop.add_timeout(datetime.timedelta(seconds=0.1), - lambda: future.set_result('asdf')) - result = yield gen.with_timeout(datetime.timedelta(seconds=3600), - future, io_loop=self.io_loop) - self.assertEqual(result, 'asdf') - - @gen_test - def test_fails_before_timeout(self): - future = Future() - self.io_loop.add_timeout( - datetime.timedelta(seconds=0.1), - lambda: future.set_exception(ZeroDivisionError())) - with self.assertRaises(ZeroDivisionError): - yield gen.with_timeout(datetime.timedelta(seconds=3600), - future, io_loop=self.io_loop) - - @gen_test - def test_already_resolved(self): - future = Future() - future.set_result('asdf') - result = yield gen.with_timeout(datetime.timedelta(seconds=3600), - future, io_loop=self.io_loop) - self.assertEqual(result, 'asdf') - - @unittest.skipIf(futures is None, 'futures module not present') - @gen_test - def test_timeout_concurrent_future(self): - with futures.ThreadPoolExecutor(1) as executor: - with self.assertRaises(gen.TimeoutError): - yield gen.with_timeout(self.io_loop.time(), - executor.submit(time.sleep, 0.1)) - - @unittest.skipIf(futures is None, 'futures module not present') - @gen_test - def test_completed_concurrent_future(self): - with futures.ThreadPoolExecutor(1) as executor: - yield gen.with_timeout(datetime.timedelta(seconds=3600), - executor.submit(lambda: None)) - - -class WaitIteratorTest(AsyncTestCase): - @gen_test - def test_empty_iterator(self): - g = gen.WaitIterator() - self.assertTrue(g.done(), 'empty generator iterated') - - with self.assertRaises(ValueError): - g = gen.WaitIterator(False, bar=False) - - self.assertEqual(g.current_index, None, "bad nil current index") - self.assertEqual(g.current_future, None, "bad nil current future") - - @gen_test - def test_already_done(self): - f1 = Future() - f2 = Future() - f3 = Future() - f1.set_result(24) - f2.set_result(42) - f3.set_result(84) - - g = gen.WaitIterator(f1, f2, f3) - i = 0 - while not g.done(): - r = yield g.next() - # Order is not guaranteed, but the current implementation - # preserves ordering of already-done Futures. - if i == 0: - self.assertEqual(g.current_index, 0) - self.assertIs(g.current_future, f1) - self.assertEqual(r, 24) - elif i == 1: - self.assertEqual(g.current_index, 1) - self.assertIs(g.current_future, f2) - self.assertEqual(r, 42) - elif i == 2: - self.assertEqual(g.current_index, 2) - self.assertIs(g.current_future, f3) - self.assertEqual(r, 84) - i += 1 - - self.assertEqual(g.current_index, None, "bad nil current index") - self.assertEqual(g.current_future, None, "bad nil current future") - - dg = gen.WaitIterator(f1=f1, f2=f2) - - while not dg.done(): - dr = yield dg.next() - if dg.current_index == "f1": - self.assertTrue(dg.current_future == f1 and dr == 24, - "WaitIterator dict status incorrect") - elif dg.current_index == "f2": - self.assertTrue(dg.current_future == f2 and dr == 42, - "WaitIterator dict status incorrect") - else: - self.fail("got bad WaitIterator index {}".format( - dg.current_index)) - - i += 1 - - self.assertEqual(dg.current_index, None, "bad nil current index") - self.assertEqual(dg.current_future, None, "bad nil current future") - - def finish_coroutines(self, iteration, futures): - if iteration == 3: - futures[2].set_result(24) - elif iteration == 5: - futures[0].set_exception(ZeroDivisionError()) - elif iteration == 8: - futures[1].set_result(42) - futures[3].set_result(84) - - if iteration < 8: - self.io_loop.add_callback(self.finish_coroutines, iteration + 1, futures) - - @gen_test - def test_iterator(self): - futures = [Future(), Future(), Future(), Future()] - - self.finish_coroutines(0, futures) - - g = gen.WaitIterator(*futures) - - i = 0 - while not g.done(): - try: - r = yield g.next() - except ZeroDivisionError: - self.assertIs(g.current_future, futures[0], - 'exception future invalid') - else: - if i == 0: - self.assertEqual(r, 24, 'iterator value incorrect') - self.assertEqual(g.current_index, 2, 'wrong index') - elif i == 2: - self.assertEqual(r, 42, 'iterator value incorrect') - self.assertEqual(g.current_index, 1, 'wrong index') - elif i == 3: - self.assertEqual(r, 84, 'iterator value incorrect') - self.assertEqual(g.current_index, 3, 'wrong index') - i += 1 - - @gen_test - def test_no_ref(self): - # In this usage, there is no direct hard reference to the - # WaitIterator itself, only the Future it returns. Since - # WaitIterator uses weak references internally to improve GC - # performance, this used to cause problems. - yield gen.with_timeout(datetime.timedelta(seconds=0.1), - gen.WaitIterator(gen.sleep(0)).next()) - - -if __name__ == '__main__': - unittest.main() diff --git a/tornado/test/gettext_translations/extract_me.py b/tornado/test/gettext_translations/extract_me.py deleted file mode 100644 index 45321cce..00000000 --- a/tornado/test/gettext_translations/extract_me.py +++ /dev/null @@ -1,16 +0,0 @@ -# flake8: noqa -# Dummy source file to allow creation of the initial .po file in the -# same way as a real project. I'm not entirely sure about the real -# workflow here, but this seems to work. -# -# 1) xgettext --language=Python --keyword=_:1,2 --keyword=pgettext:1c,2 --keyword=pgettext:1c,2,3 extract_me.py -o tornado_test.po -# 2) Edit tornado_test.po, setting CHARSET, Plural-Forms and setting msgstr -# 3) msgfmt tornado_test.po -o tornado_test.mo -# 4) Put the file in the proper location: $LANG/LC_MESSAGES - -from __future__ import absolute_import, division, print_function, with_statement -_("school") -pgettext("law", "right") -pgettext("good", "right") -pgettext("organization", "club", "clubs", 1) -pgettext("stick", "club", "clubs", 1) diff --git a/tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.mo b/tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.mo deleted file mode 100644 index a97bf9c57460ecfc27761accf90d712ea5cebb44..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 665 zcmYk3PjAyO7{(2hf8hd1hzkcFL6b*PG%=;?w5-jxh@`2~Zqm59iI;kKc4a#Z&~AJN zz5pk7=gei_VK?{)ddc_y6;;R;R4AB&o;|(*{A@;`klngX$w<1GoS%|xSutEHQbYJ5j z2>p#U|CR4UkQD4acQ0S&j^n5xSx$x#KFGr?S$mt0VlSn}lBuTB2x^rM@!nyY;!%{v zcq`7LB;ARI!y=wcwjnC(hSrQs89fVe8jbc3-N;*Mx+C~H{DoBpM$M8eUVUG%?t23z zEt9a_#|6x7*$4Y_At;wUT+XRB%=R05LN-@9H`WQ$B$lPBxU56GIpfwFi$+sH_LM#| zA(o5w*7UnQ{MYuMOT3MP7d;ONhG(2fr, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-27 11:05+0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: extract_me.py:11 -msgid "school" -msgstr "école" - -#: extract_me.py:12 -msgctxt "law" -msgid "right" -msgstr "le droit" - -#: extract_me.py:13 -msgctxt "good" -msgid "right" -msgstr "le bien" - -#: extract_me.py:14 -msgctxt "organization" -msgid "club" -msgid_plural "clubs" -msgstr[0] "le club" -msgstr[1] "les clubs" - -#: extract_me.py:15 -msgctxt "stick" -msgid "club" -msgid_plural "clubs" -msgstr[0] "le bâton" -msgstr[1] "les bâtons" diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py deleted file mode 100644 index ecc63e4a..00000000 --- a/tornado/test/httpclient_test.py +++ /dev/null @@ -1,607 +0,0 @@ -#!/usr/bin/env python - -from __future__ import absolute_import, division, print_function, with_statement - -import base64 -import binascii -from contextlib import closing -import functools -import sys -import threading -import datetime -from io import BytesIO - -from tornado.escape import utf8 -from tornado import gen -from tornado.httpclient import HTTPRequest, HTTPResponse, _RequestProxy, HTTPError, HTTPClient -from tornado.httpserver import HTTPServer -from tornado.ioloop import IOLoop -from tornado.iostream import IOStream -from tornado.log import gen_log -from tornado import netutil -from tornado.stack_context import ExceptionStackContext, NullContext -from tornado.testing import AsyncHTTPTestCase, bind_unused_port, gen_test, ExpectLog -from tornado.test.util import unittest, skipOnTravis -from tornado.util import u -from tornado.web import Application, RequestHandler, url -from tornado.httputil import format_timestamp, HTTPHeaders - - -class HelloWorldHandler(RequestHandler): - def get(self): - name = self.get_argument("name", "world") - self.set_header("Content-Type", "text/plain") - self.finish("Hello %s!" % name) - - -class PostHandler(RequestHandler): - def post(self): - self.finish("Post arg1: %s, arg2: %s" % ( - self.get_argument("arg1"), self.get_argument("arg2"))) - - -class PutHandler(RequestHandler): - def put(self): - self.write("Put body: ") - self.write(self.request.body) - - -class RedirectHandler(RequestHandler): - def prepare(self): - self.redirect(self.get_argument("url"), - status=int(self.get_argument("status", "302"))) - - -class ChunkHandler(RequestHandler): - @gen.coroutine - def get(self): - self.write("asdf") - self.flush() - # Wait a bit to ensure the chunks are sent and received separately. - yield gen.sleep(0.01) - self.write("qwer") - - -class AuthHandler(RequestHandler): - def get(self): - self.finish(self.request.headers["Authorization"]) - - -class CountdownHandler(RequestHandler): - def get(self, count): - count = int(count) - if count > 0: - self.redirect(self.reverse_url("countdown", count - 1)) - else: - self.write("Zero") - - -class EchoPostHandler(RequestHandler): - def post(self): - self.write(self.request.body) - - -class UserAgentHandler(RequestHandler): - def get(self): - self.write(self.request.headers.get('User-Agent', 'User agent not set')) - - -class ContentLength304Handler(RequestHandler): - def get(self): - self.set_status(304) - self.set_header('Content-Length', 42) - - def _clear_headers_for_304(self): - # Tornado strips content-length from 304 responses, but here we - # want to simulate servers that include the headers anyway. - pass - - -class PatchHandler(RequestHandler): - - def patch(self): - "Return the request payload - so we can check it is being kept" - self.write(self.request.body) - - -class AllMethodsHandler(RequestHandler): - SUPPORTED_METHODS = RequestHandler.SUPPORTED_METHODS + ('OTHER',) - - def method(self): - self.write(self.request.method) - - get = post = put = delete = options = patch = other = method - -# These tests end up getting run redundantly: once here with the default -# HTTPClient implementation, and then again in each implementation's own -# test suite. - - -class HTTPClientCommonTestCase(AsyncHTTPTestCase): - def get_app(self): - return Application([ - url("/hello", HelloWorldHandler), - url("/post", PostHandler), - url("/put", PutHandler), - url("/redirect", RedirectHandler), - url("/chunk", ChunkHandler), - url("/auth", AuthHandler), - url("/countdown/([0-9]+)", CountdownHandler, name="countdown"), - url("/echopost", EchoPostHandler), - url("/user_agent", UserAgentHandler), - url("/304_with_content_length", ContentLength304Handler), - url("/all_methods", AllMethodsHandler), - url('/patch', PatchHandler), - ], gzip=True) - - def test_patch_receives_payload(self): - body = b"some patch data" - response = self.fetch("/patch", method='PATCH', body=body) - self.assertEqual(response.code, 200) - self.assertEqual(response.body, body) - - @skipOnTravis - def test_hello_world(self): - response = self.fetch("/hello") - self.assertEqual(response.code, 200) - self.assertEqual(response.headers["Content-Type"], "text/plain") - self.assertEqual(response.body, b"Hello world!") - self.assertEqual(int(response.request_time), 0) - - response = self.fetch("/hello?name=Ben") - self.assertEqual(response.body, b"Hello Ben!") - - def test_streaming_callback(self): - # streaming_callback is also tested in test_chunked - chunks = [] - response = self.fetch("/hello", - streaming_callback=chunks.append) - # with streaming_callback, data goes to the callback and not response.body - self.assertEqual(chunks, [b"Hello world!"]) - self.assertFalse(response.body) - - def test_post(self): - response = self.fetch("/post", method="POST", - body="arg1=foo&arg2=bar") - self.assertEqual(response.code, 200) - self.assertEqual(response.body, b"Post arg1: foo, arg2: bar") - - def test_chunked(self): - response = self.fetch("/chunk") - self.assertEqual(response.body, b"asdfqwer") - - chunks = [] - response = self.fetch("/chunk", - streaming_callback=chunks.append) - self.assertEqual(chunks, [b"asdf", b"qwer"]) - self.assertFalse(response.body) - - def test_chunked_close(self): - # test case in which chunks spread read-callback processing - # over several ioloop iterations, but the connection is already closed. - sock, port = bind_unused_port() - with closing(sock): - def write_response(stream, request_data): - if b"HTTP/1." not in request_data: - self.skipTest("requires HTTP/1.x") - stream.write(b"""\ -HTTP/1.1 200 OK -Transfer-Encoding: chunked - -1 -1 -1 -2 -0 - -""".replace(b"\n", b"\r\n"), callback=stream.close) - - def accept_callback(conn, address): - # fake an HTTP server using chunked encoding where the final chunks - # and connection close all happen at once - stream = IOStream(conn, io_loop=self.io_loop) - stream.read_until(b"\r\n\r\n", - functools.partial(write_response, stream)) - netutil.add_accept_handler(sock, accept_callback, self.io_loop) - self.http_client.fetch("http://127.0.0.1:%d/" % port, self.stop) - resp = self.wait() - resp.rethrow() - self.assertEqual(resp.body, b"12") - self.io_loop.remove_handler(sock.fileno()) - - def test_streaming_stack_context(self): - chunks = [] - exc_info = [] - - def error_handler(typ, value, tb): - exc_info.append((typ, value, tb)) - return True - - def streaming_cb(chunk): - chunks.append(chunk) - if chunk == b'qwer': - 1 / 0 - - with ExceptionStackContext(error_handler): - self.fetch('/chunk', streaming_callback=streaming_cb) - - self.assertEqual(chunks, [b'asdf', b'qwer']) - self.assertEqual(1, len(exc_info)) - self.assertIs(exc_info[0][0], ZeroDivisionError) - - def test_basic_auth(self): - self.assertEqual(self.fetch("/auth", auth_username="Aladdin", - auth_password="open sesame").body, - b"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==") - - def test_basic_auth_explicit_mode(self): - self.assertEqual(self.fetch("/auth", auth_username="Aladdin", - auth_password="open sesame", - auth_mode="basic").body, - b"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==") - - def test_unsupported_auth_mode(self): - # curl and simple clients handle errors a bit differently; the - # important thing is that they don't fall back to basic auth - # on an unknown mode. - with ExpectLog(gen_log, "uncaught exception", required=False): - with self.assertRaises((ValueError, HTTPError)): - response = self.fetch("/auth", auth_username="Aladdin", - auth_password="open sesame", - auth_mode="asdf") - response.rethrow() - - def test_follow_redirect(self): - response = self.fetch("/countdown/2", follow_redirects=False) - self.assertEqual(302, response.code) - self.assertTrue(response.headers["Location"].endswith("/countdown/1")) - - response = self.fetch("/countdown/2") - self.assertEqual(200, response.code) - self.assertTrue(response.effective_url.endswith("/countdown/0")) - self.assertEqual(b"Zero", response.body) - - def test_credentials_in_url(self): - url = self.get_url("/auth").replace("http://", "http://me:secret@") - self.http_client.fetch(url, self.stop) - response = self.wait() - self.assertEqual(b"Basic " + base64.b64encode(b"me:secret"), - response.body) - - def test_body_encoding(self): - unicode_body = u("\xe9") - byte_body = binascii.a2b_hex(b"e9") - - # unicode string in body gets converted to utf8 - response = self.fetch("/echopost", method="POST", body=unicode_body, - headers={"Content-Type": "application/blah"}) - self.assertEqual(response.headers["Content-Length"], "2") - self.assertEqual(response.body, utf8(unicode_body)) - - # byte strings pass through directly - response = self.fetch("/echopost", method="POST", - body=byte_body, - headers={"Content-Type": "application/blah"}) - self.assertEqual(response.headers["Content-Length"], "1") - self.assertEqual(response.body, byte_body) - - # Mixing unicode in headers and byte string bodies shouldn't - # break anything - response = self.fetch("/echopost", method="POST", body=byte_body, - headers={"Content-Type": "application/blah"}, - user_agent=u("foo")) - self.assertEqual(response.headers["Content-Length"], "1") - self.assertEqual(response.body, byte_body) - - def test_types(self): - response = self.fetch("/hello") - self.assertEqual(type(response.body), bytes) - self.assertEqual(type(response.headers["Content-Type"]), str) - self.assertEqual(type(response.code), int) - self.assertEqual(type(response.effective_url), str) - - def test_header_callback(self): - first_line = [] - headers = {} - chunks = [] - - def header_callback(header_line): - if header_line.startswith('HTTP/1.1 101'): - # Upgrading to HTTP/2 - pass - elif header_line.startswith('HTTP/'): - first_line.append(header_line) - elif header_line != '\r\n': - k, v = header_line.split(':', 1) - headers[k.lower()] = v.strip() - - def streaming_callback(chunk): - # All header callbacks are run before any streaming callbacks, - # so the header data is available to process the data as it - # comes in. - self.assertEqual(headers['content-type'], 'text/html; charset=UTF-8') - chunks.append(chunk) - - self.fetch('/chunk', header_callback=header_callback, - streaming_callback=streaming_callback) - self.assertEqual(len(first_line), 1, first_line) - self.assertRegexpMatches(first_line[0], 'HTTP/[0-9]\\.[0-9] 200.*\r\n') - self.assertEqual(chunks, [b'asdf', b'qwer']) - - def test_header_callback_stack_context(self): - exc_info = [] - - def error_handler(typ, value, tb): - exc_info.append((typ, value, tb)) - return True - - def header_callback(header_line): - if header_line.lower().startswith('content-type:'): - 1 / 0 - - with ExceptionStackContext(error_handler): - self.fetch('/chunk', header_callback=header_callback) - self.assertEqual(len(exc_info), 1) - self.assertIs(exc_info[0][0], ZeroDivisionError) - - def test_configure_defaults(self): - defaults = dict(user_agent='TestDefaultUserAgent', allow_ipv6=False) - # Construct a new instance of the configured client class - client = self.http_client.__class__(self.io_loop, force_instance=True, - defaults=defaults) - try: - client.fetch(self.get_url('/user_agent'), callback=self.stop) - response = self.wait() - self.assertEqual(response.body, b'TestDefaultUserAgent') - finally: - client.close() - - def test_header_types(self): - # Header values may be passed as character or utf8 byte strings, - # in a plain dictionary or an HTTPHeaders object. - # Keys must always be the native str type. - # All combinations should have the same results on the wire. - for value in [u("MyUserAgent"), b"MyUserAgent"]: - for container in [dict, HTTPHeaders]: - headers = container() - headers['User-Agent'] = value - resp = self.fetch('/user_agent', headers=headers) - self.assertEqual( - resp.body, b"MyUserAgent", - "response=%r, value=%r, container=%r" % - (resp.body, value, container)) - - def test_304_with_content_length(self): - # According to the spec 304 responses SHOULD NOT include - # Content-Length or other entity headers, but some servers do it - # anyway. - # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5 - response = self.fetch('/304_with_content_length') - self.assertEqual(response.code, 304) - self.assertEqual(response.headers['Content-Length'], '42') - - def test_final_callback_stack_context(self): - # The final callback should be run outside of the httpclient's - # stack_context. We want to ensure that there is not stack_context - # between the user's callback and the IOLoop, so monkey-patch - # IOLoop.handle_callback_exception and disable the test harness's - # context with a NullContext. - # Note that this does not apply to secondary callbacks (header - # and streaming_callback), as errors there must be seen as errors - # by the http client so it can clean up the connection. - exc_info = [] - - def handle_callback_exception(callback): - exc_info.append(sys.exc_info()) - self.stop() - self.io_loop.handle_callback_exception = handle_callback_exception - with NullContext(): - self.http_client.fetch(self.get_url('/hello'), - lambda response: 1 / 0) - self.wait() - self.assertEqual(exc_info[0][0], ZeroDivisionError) - - @gen_test - def test_future_interface(self): - response = yield self.http_client.fetch(self.get_url('/hello')) - self.assertEqual(response.body, b'Hello world!') - - @gen_test - def test_future_http_error(self): - with self.assertRaises(HTTPError) as context: - yield self.http_client.fetch(self.get_url('/notfound')) - self.assertEqual(context.exception.code, 404) - self.assertEqual(context.exception.response.code, 404) - - @gen_test - def test_future_http_error_no_raise(self): - response = yield self.http_client.fetch(self.get_url('/notfound'), raise_error=False) - self.assertEqual(response.code, 404) - - @gen_test - def test_reuse_request_from_response(self): - # The response.request attribute should be an HTTPRequest, not - # a _RequestProxy. - # This test uses self.http_client.fetch because self.fetch calls - # self.get_url on the input unconditionally. - url = self.get_url('/hello') - response = yield self.http_client.fetch(url) - self.assertEqual(response.request.url, url) - self.assertTrue(isinstance(response.request, HTTPRequest)) - response2 = yield self.http_client.fetch(response.request) - self.assertEqual(response2.body, b'Hello world!') - - def test_all_methods(self): - for method in ['GET', 'DELETE', 'OPTIONS']: - response = self.fetch('/all_methods', method=method) - self.assertEqual(response.body, utf8(method)) - for method in ['POST', 'PUT', 'PATCH']: - response = self.fetch('/all_methods', method=method, body=b'') - self.assertEqual(response.body, utf8(method)) - response = self.fetch('/all_methods', method='HEAD') - self.assertEqual(response.body, b'') - response = self.fetch('/all_methods', method='OTHER', - allow_nonstandard_methods=True) - self.assertEqual(response.body, b'OTHER') - - @gen_test - def test_body_sanity_checks(self): - hello_url = self.get_url('/hello') - with self.assertRaises(ValueError) as context: - yield self.http_client.fetch(hello_url, body='data') - - self.assertTrue('must be None' in str(context.exception)) - - with self.assertRaises(ValueError) as context: - yield self.http_client.fetch(hello_url, method='POST') - - self.assertTrue('must not be None' in str(context.exception)) - - # This test causes odd failures with the combination of - # curl_httpclient (at least with the version of libcurl available - # on ubuntu 12.04), TwistedIOLoop, and epoll. For POST (but not PUT), - # curl decides the response came back too soon and closes the connection - # to start again. It does this *before* telling the socket callback to - # unregister the FD. Some IOLoop implementations have special kernel - # integration to discover this immediately. Tornado's IOLoops - # ignore errors on remove_handler to accommodate this behavior, but - # Twisted's reactor does not. The removeReader call fails and so - # do all future removeAll calls (which our tests do at cleanup). - # - # def test_post_307(self): - # response = self.fetch("/redirect?status=307&url=/post", - # method="POST", body=b"arg1=foo&arg2=bar") - # self.assertEqual(response.body, b"Post arg1: foo, arg2: bar") - - def test_put_307(self): - response = self.fetch("/redirect?status=307&url=/put", - method="PUT", body=b"hello") - response.rethrow() - self.assertEqual(response.body, b"Put body: hello") - - -class RequestProxyTest(unittest.TestCase): - def test_request_set(self): - proxy = _RequestProxy(HTTPRequest('http://example.com/', - user_agent='foo'), - dict()) - self.assertEqual(proxy.user_agent, 'foo') - - def test_default_set(self): - proxy = _RequestProxy(HTTPRequest('http://example.com/'), - dict(network_interface='foo')) - self.assertEqual(proxy.network_interface, 'foo') - - def test_both_set(self): - proxy = _RequestProxy(HTTPRequest('http://example.com/', - proxy_host='foo'), - dict(proxy_host='bar')) - self.assertEqual(proxy.proxy_host, 'foo') - - def test_neither_set(self): - proxy = _RequestProxy(HTTPRequest('http://example.com/'), - dict()) - self.assertIs(proxy.auth_username, None) - - def test_bad_attribute(self): - proxy = _RequestProxy(HTTPRequest('http://example.com/'), - dict()) - with self.assertRaises(AttributeError): - proxy.foo - - def test_defaults_none(self): - proxy = _RequestProxy(HTTPRequest('http://example.com/'), None) - self.assertIs(proxy.auth_username, None) - - -class HTTPResponseTestCase(unittest.TestCase): - def test_str(self): - response = HTTPResponse(HTTPRequest('http://example.com'), - 200, headers={}, buffer=BytesIO()) - s = str(response) - self.assertTrue(s.startswith('HTTPResponse(')) - self.assertIn('code=200', s) - - -class SyncHTTPClientTest(unittest.TestCase): - def setUp(self): - if IOLoop.configured_class().__name__ in ('TwistedIOLoop', - 'AsyncIOMainLoop'): - # TwistedIOLoop only supports the global reactor, so we can't have - # separate IOLoops for client and server threads. - # AsyncIOMainLoop doesn't work with the default policy - # (although it could with some tweaks to this test and a - # policy that created loops for non-main threads). - raise unittest.SkipTest( - 'Sync HTTPClient not compatible with TwistedIOLoop or ' - 'AsyncIOMainLoop') - self.server_ioloop = IOLoop() - - sock, self.port = bind_unused_port() - app = Application([('/', HelloWorldHandler)]) - self.server = HTTPServer(app, io_loop=self.server_ioloop) - self.server.add_socket(sock) - - self.server_thread = threading.Thread(target=self.server_ioloop.start) - self.server_thread.start() - - self.http_client = HTTPClient() - - def tearDown(self): - def stop_server(): - self.server.stop() - # Delay the shutdown of the IOLoop by one iteration because - # the server may still have some cleanup work left when - # the client finishes with the response (this is noticable - # with http/2, which leaves a Future with an unexamined - # StreamClosedError on the loop). - self.server_ioloop.add_callback(self.server_ioloop.stop) - self.server_ioloop.add_callback(stop_server) - self.server_thread.join() - self.http_client.close() - self.server_ioloop.close(all_fds=True) - - def get_url(self, path): - return 'http://127.0.0.1:%d%s' % (self.port, path) - - def test_sync_client(self): - response = self.http_client.fetch(self.get_url('/')) - self.assertEqual(b'Hello world!', response.body) - - def test_sync_client_error(self): - # Synchronous HTTPClient raises errors directly; no need for - # response.rethrow() - with self.assertRaises(HTTPError) as assertion: - self.http_client.fetch(self.get_url('/notfound')) - self.assertEqual(assertion.exception.code, 404) - - -class HTTPRequestTestCase(unittest.TestCase): - def test_headers(self): - request = HTTPRequest('http://example.com', headers={'foo': 'bar'}) - self.assertEqual(request.headers, {'foo': 'bar'}) - - def test_headers_setter(self): - request = HTTPRequest('http://example.com') - request.headers = {'bar': 'baz'} - self.assertEqual(request.headers, {'bar': 'baz'}) - - def test_null_headers_setter(self): - request = HTTPRequest('http://example.com') - request.headers = None - self.assertEqual(request.headers, {}) - - def test_body(self): - request = HTTPRequest('http://example.com', body='foo') - self.assertEqual(request.body, utf8('foo')) - - def test_body_setter(self): - request = HTTPRequest('http://example.com') - request.body = 'foo' - self.assertEqual(request.body, utf8('foo')) - - def test_if_modified_since(self): - http_date = datetime.datetime.utcnow() - request = HTTPRequest('http://example.com', if_modified_since=http_date) - self.assertEqual(request.headers, - {'If-Modified-Since': format_timestamp(http_date)}) diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py deleted file mode 100644 index f05599dd..00000000 --- a/tornado/test/httpserver_test.py +++ /dev/null @@ -1,1081 +0,0 @@ -#!/usr/bin/env python - - -from __future__ import absolute_import, division, print_function, with_statement -from tornado import netutil -from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str -from tornado import gen -from tornado.http1connection import HTTP1Connection -from tornado.httpserver import HTTPServer -from tornado.httputil import HTTPHeaders, HTTPMessageDelegate, HTTPServerConnectionDelegate, ResponseStartLine -from tornado.iostream import IOStream -from tornado.log import gen_log -from tornado.netutil import ssl_options_to_context -from tornado.simple_httpclient import SimpleAsyncHTTPClient -from tornado.testing import AsyncHTTPTestCase, AsyncHTTPSTestCase, AsyncTestCase, ExpectLog, gen_test -from tornado.test.util import unittest, skipOnTravis -from tornado.util import u -from tornado.web import Application, RequestHandler, asynchronous, stream_request_body -from contextlib import closing -import datetime -import gzip -import os -import shutil -import socket -import ssl -import sys -import tempfile -from io import BytesIO - - -def read_stream_body(stream, callback): - """Reads an HTTP response from `stream` and runs callback with its - headers and body.""" - chunks = [] - - class Delegate(HTTPMessageDelegate): - def headers_received(self, start_line, headers): - self.headers = headers - - def data_received(self, chunk): - chunks.append(chunk) - - def finish(self): - callback((self.headers, b''.join(chunks))) - conn = HTTP1Connection(stream, True) - conn.read_response(Delegate()) - - -class HandlerBaseTestCase(AsyncHTTPTestCase): - def get_app(self): - return Application([('/', self.__class__.Handler)]) - - def fetch_json(self, *args, **kwargs): - response = self.fetch(*args, **kwargs) - response.rethrow() - return json_decode(response.body) - - -class HelloWorldRequestHandler(RequestHandler): - def initialize(self, protocol="http"): - self.expected_protocol = protocol - - def get(self): - if self.request.protocol != self.expected_protocol: - raise Exception("unexpected protocol") - self.finish("Hello world") - - def post(self): - self.finish("Got %d bytes in POST" % len(self.request.body)) - - -# In pre-1.0 versions of openssl, SSLv23 clients always send SSLv2 -# ClientHello messages, which are rejected by SSLv3 and TLSv1 -# servers. Note that while the OPENSSL_VERSION_INFO was formally -# introduced in python3.2, it was present but undocumented in -# python 2.7 -skipIfOldSSL = unittest.skipIf( - getattr(ssl, 'OPENSSL_VERSION_INFO', (0, 0)) < (1, 0), - "old version of ssl module and/or openssl") - - -class BaseSSLTest(AsyncHTTPSTestCase): - def get_app(self): - return Application([('/', HelloWorldRequestHandler, - dict(protocol="https"))]) - - -class SSLTestMixin(object): - def get_ssl_options(self): - return dict(ssl_version=self.get_ssl_version(), - **AsyncHTTPSTestCase.get_ssl_options()) - - def get_ssl_version(self): - raise NotImplementedError() - - def test_ssl(self): - response = self.fetch('/') - self.assertEqual(response.body, b"Hello world") - - def test_large_post(self): - response = self.fetch('/', - method='POST', - body='A' * 5000) - self.assertEqual(response.body, b"Got 5000 bytes in POST") - - def test_non_ssl_request(self): - # Make sure the server closes the connection when it gets a non-ssl - # connection, rather than waiting for a timeout or otherwise - # misbehaving. - with ExpectLog(gen_log, '(SSL Error|uncaught exception)'): - with ExpectLog(gen_log, 'Uncaught exception', required=False): - self.http_client.fetch( - self.get_url("/").replace('https:', 'http:'), - self.stop, - request_timeout=3600, - connect_timeout=3600) - response = self.wait() - self.assertEqual(response.code, 599) - -# Python's SSL implementation differs significantly between versions. -# For example, SSLv3 and TLSv1 throw an exception if you try to read -# from the socket before the handshake is complete, but the default -# of SSLv23 allows it. - - -class SSLv23Test(BaseSSLTest, SSLTestMixin): - def get_ssl_version(self): - return ssl.PROTOCOL_SSLv23 - - -@skipIfOldSSL -class SSLv3Test(BaseSSLTest, SSLTestMixin): - def get_ssl_version(self): - return ssl.PROTOCOL_SSLv3 - - -@skipIfOldSSL -class TLSv1Test(BaseSSLTest, SSLTestMixin): - def get_ssl_version(self): - return ssl.PROTOCOL_TLSv1 - - -@unittest.skipIf(not hasattr(ssl, 'SSLContext'), 'ssl.SSLContext not present') -class SSLContextTest(BaseSSLTest, SSLTestMixin): - def get_ssl_options(self): - context = ssl_options_to_context( - AsyncHTTPSTestCase.get_ssl_options(self)) - assert isinstance(context, ssl.SSLContext) - return context - - -class BadSSLOptionsTest(unittest.TestCase): - def test_missing_arguments(self): - application = Application() - self.assertRaises(KeyError, HTTPServer, application, ssl_options={ - "keyfile": "/__missing__.crt", - }) - - def test_missing_key(self): - """A missing SSL key should cause an immediate exception.""" - - application = Application() - module_dir = os.path.dirname(__file__) - existing_certificate = os.path.join(module_dir, 'test.crt') - existing_key = os.path.join(module_dir, 'test.key') - - self.assertRaises((ValueError, IOError), - HTTPServer, application, ssl_options={ - "certfile": "/__mising__.crt", - }) - self.assertRaises((ValueError, IOError), - HTTPServer, application, ssl_options={ - "certfile": existing_certificate, - "keyfile": "/__missing__.key" - }) - - # This actually works because both files exist - HTTPServer(application, ssl_options={ - "certfile": existing_certificate, - "keyfile": existing_key, - }) - - -class MultipartTestHandler(RequestHandler): - def post(self): - self.finish({"header": self.request.headers["X-Header-Encoding-Test"], - "argument": self.get_argument("argument"), - "filename": self.request.files["files"][0].filename, - "filebody": _unicode(self.request.files["files"][0]["body"]), - }) - - -# This test is also called from wsgi_test -class HTTPConnectionTest(AsyncHTTPTestCase): - def get_handlers(self): - return [("/multipart", MultipartTestHandler), - ("/hello", HelloWorldRequestHandler)] - - def get_app(self): - return Application(self.get_handlers()) - - def raw_fetch(self, headers, body, newline=b"\r\n"): - with closing(IOStream(socket.socket())) as stream: - stream.connect(('127.0.0.1', self.get_http_port()), self.stop) - self.wait() - stream.write( - newline.join(headers + - [utf8("Content-Length: %d" % len(body))]) + - newline + newline + body) - read_stream_body(stream, self.stop) - headers, body = self.wait() - return body - - def test_multipart_form(self): - # Encodings here are tricky: Headers are latin1, bodies can be - # anything (we use utf8 by default). - response = self.raw_fetch([ - b"POST /multipart HTTP/1.0", - b"Content-Type: multipart/form-data; boundary=1234567890", - b"X-Header-encoding-test: \xe9", - ], - b"\r\n".join([ - b"Content-Disposition: form-data; name=argument", - b"", - u("\u00e1").encode("utf-8"), - b"--1234567890", - u('Content-Disposition: form-data; name="files"; filename="\u00f3"').encode("utf8"), - b"", - u("\u00fa").encode("utf-8"), - b"--1234567890--", - b"", - ])) - data = json_decode(response) - self.assertEqual(u("\u00e9"), data["header"]) - self.assertEqual(u("\u00e1"), data["argument"]) - self.assertEqual(u("\u00f3"), data["filename"]) - self.assertEqual(u("\u00fa"), data["filebody"]) - - def test_newlines(self): - # We support both CRLF and bare LF as line separators. - for newline in (b"\r\n", b"\n"): - response = self.raw_fetch([b"GET /hello HTTP/1.0"], b"", - newline=newline) - self.assertEqual(response, b'Hello world') - - def test_100_continue(self): - # Run through a 100-continue interaction by hand: - # When given Expect: 100-continue, we get a 100 response after the - # headers, and then the real response after the body. - stream = IOStream(socket.socket(), io_loop=self.io_loop) - stream.connect(("127.0.0.1", self.get_http_port()), callback=self.stop) - self.wait() - stream.write(b"\r\n".join([b"POST /hello HTTP/1.1", - b"Content-Length: 1024", - b"Expect: 100-continue", - b"Connection: close", - b"\r\n"]), callback=self.stop) - self.wait() - stream.read_until(b"\r\n\r\n", self.stop) - data = self.wait() - self.assertTrue(data.startswith(b"HTTP/1.1 100 "), data) - stream.write(b"a" * 1024) - stream.read_until(b"\r\n", self.stop) - first_line = self.wait() - self.assertTrue(first_line.startswith(b"HTTP/1.1 200"), first_line) - stream.read_until(b"\r\n\r\n", self.stop) - header_data = self.wait() - headers = HTTPHeaders.parse(native_str(header_data.decode('latin1'))) - stream.read_bytes(int(headers["Content-Length"]), self.stop) - body = self.wait() - self.assertEqual(body, b"Got 1024 bytes in POST") - stream.close() - - -class EchoHandler(RequestHandler): - def get(self): - self.write(recursive_unicode(self.request.arguments)) - - def post(self): - self.write(recursive_unicode(self.request.arguments)) - - -class TypeCheckHandler(RequestHandler): - def prepare(self): - self.errors = {} - fields = [ - ('method', str), - ('uri', str), - ('version', str), - ('remote_ip', str), - ('protocol', str), - ('host', str), - ('path', str), - ('query', str), - ] - for field, expected_type in fields: - self.check_type(field, getattr(self.request, field), expected_type) - - self.check_type('header_key', list(self.request.headers.keys())[0], str) - self.check_type('header_value', list(self.request.headers.values())[0], str) - - self.check_type('cookie_key', list(self.request.cookies.keys())[0], str) - self.check_type('cookie_value', list(self.request.cookies.values())[0].value, str) - # secure cookies - - self.check_type('arg_key', list(self.request.arguments.keys())[0], str) - self.check_type('arg_value', list(self.request.arguments.values())[0][0], bytes) - - def post(self): - self.check_type('body', self.request.body, bytes) - self.write(self.errors) - - def get(self): - self.write(self.errors) - - def check_type(self, name, obj, expected_type): - actual_type = type(obj) - if expected_type != actual_type: - self.errors[name] = "expected %s, got %s" % (expected_type, - actual_type) - - -class HTTPServerTest(AsyncHTTPTestCase): - def get_app(self): - return Application([("/echo", EchoHandler), - ("/typecheck", TypeCheckHandler), - ("//doubleslash", EchoHandler), - ]) - - def test_query_string_encoding(self): - response = self.fetch("/echo?foo=%C3%A9") - data = json_decode(response.body) - self.assertEqual(data, {u("foo"): [u("\u00e9")]}) - - def test_empty_query_string(self): - response = self.fetch("/echo?foo=&foo=") - data = json_decode(response.body) - self.assertEqual(data, {u("foo"): [u(""), u("")]}) - - def test_empty_post_parameters(self): - response = self.fetch("/echo", method="POST", body="foo=&bar=") - data = json_decode(response.body) - self.assertEqual(data, {u("foo"): [u("")], u("bar"): [u("")]}) - - def test_types(self): - headers = {"Cookie": "foo=bar"} - response = self.fetch("/typecheck?foo=bar", headers=headers) - data = json_decode(response.body) - self.assertEqual(data, {}) - - response = self.fetch("/typecheck", method="POST", body="foo=bar", headers=headers) - data = json_decode(response.body) - self.assertEqual(data, {}) - - def test_double_slash(self): - # urlparse.urlsplit (which tornado.httpserver used to use - # incorrectly) would parse paths beginning with "//" as - # protocol-relative urls. - response = self.fetch("//doubleslash") - self.assertEqual(200, response.code) - self.assertEqual(json_decode(response.body), {}) - - def test_malformed_body(self): - # parse_qs is pretty forgiving, but it will fail on python 3 - # if the data is not utf8. On python 2 parse_qs will work, - # but then the recursive_unicode call in EchoHandler will - # fail. - if str is bytes: - return - with ExpectLog(gen_log, 'Invalid x-www-form-urlencoded body'): - response = self.fetch( - '/echo', method="POST", - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - body=b'\xe9') - self.assertEqual(200, response.code) - self.assertEqual(b'{}', response.body) - - -class HTTPServerRawTest(AsyncHTTPTestCase): - def get_app(self): - return Application([ - ('/echo', EchoHandler), - ]) - - def setUp(self): - super(HTTPServerRawTest, self).setUp() - self.stream = IOStream(socket.socket()) - self.stream.connect(('127.0.0.1', self.get_http_port()), self.stop) - self.wait() - - def tearDown(self): - self.stream.close() - super(HTTPServerRawTest, self).tearDown() - - def test_empty_request(self): - self.stream.close() - self.io_loop.add_timeout(datetime.timedelta(seconds=0.001), self.stop) - self.wait() - - def test_malformed_first_line(self): - with ExpectLog(gen_log, '.*Malformed HTTP request line'): - self.stream.write(b'asdf\r\n\r\n') - # TODO: need an async version of ExpectLog so we don't need - # hard-coded timeouts here. - self.io_loop.add_timeout(datetime.timedelta(seconds=0.01), - self.stop) - self.wait() - - def test_malformed_headers(self): - with ExpectLog(gen_log, '.*Malformed HTTP headers'): - self.stream.write(b'GET / HTTP/1.0\r\nasdf\r\n\r\n') - self.io_loop.add_timeout(datetime.timedelta(seconds=0.01), - self.stop) - self.wait() - - def test_chunked_request_body(self): - # Chunked requests are not widely supported and we don't have a way - # to generate them in AsyncHTTPClient, but HTTPServer will read them. - self.stream.write(b"""\ -POST /echo HTTP/1.1 -Transfer-Encoding: chunked -Content-Type: application/x-www-form-urlencoded - -4 -foo= -3 -bar -0 - -""".replace(b"\n", b"\r\n")) - read_stream_body(self.stream, self.stop) - headers, response = self.wait() - self.assertEqual(json_decode(response), {u('foo'): [u('bar')]}) - - -class XHeaderTest(HandlerBaseTestCase): - class Handler(RequestHandler): - def get(self): - self.write(dict(remote_ip=self.request.remote_ip, - remote_protocol=self.request.protocol)) - - def get_httpserver_options(self): - return dict(xheaders=True) - - def test_ip_headers(self): - self.assertEqual(self.fetch_json("/")["remote_ip"], "127.0.0.1") - - valid_ipv4 = {"X-Real-IP": "4.4.4.4"} - self.assertEqual( - self.fetch_json("/", headers=valid_ipv4)["remote_ip"], - "4.4.4.4") - - valid_ipv4_list = {"X-Forwarded-For": "127.0.0.1, 4.4.4.4"} - self.assertEqual( - self.fetch_json("/", headers=valid_ipv4_list)["remote_ip"], - "4.4.4.4") - - valid_ipv6 = {"X-Real-IP": "2620:0:1cfe:face:b00c::3"} - self.assertEqual( - self.fetch_json("/", headers=valid_ipv6)["remote_ip"], - "2620:0:1cfe:face:b00c::3") - - valid_ipv6_list = {"X-Forwarded-For": "::1, 2620:0:1cfe:face:b00c::3"} - self.assertEqual( - self.fetch_json("/", headers=valid_ipv6_list)["remote_ip"], - "2620:0:1cfe:face:b00c::3") - - invalid_chars = {"X-Real-IP": "4.4.4.4 - - description]]> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_content_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/entry_content_script_inline.xml deleted file mode 100644 index 9c5c6239..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_content_script_inline.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -
safe description
-
-
\ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_content_style.xml b/lib/feedparser/tests/wellformed/sanitize/entry_content_style.xml deleted file mode 100644 index b243bf18..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_content_style.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_content_style_tag.xml b/lib/feedparser/tests/wellformed/sanitize/entry_content_style_tag.xml deleted file mode 100644 index 6b38beb9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_content_style_tag.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<style>b {color:red}</style> <b>description</b> - - diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_applet.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_applet.xml deleted file mode 100644 index 4404687f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_applet.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<applet code="foo.class" codebase="http://example.com/"></applet> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_blink.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_blink.xml deleted file mode 100644 index 64e95bc6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_blink.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<blink>safe</blink> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_crazy.xml deleted file mode 100644 index cdc2ad17..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_crazy.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_embed.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_embed.xml deleted file mode 100644 index f7403ef9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_embed.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<embed src="http://example.com/"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_frame.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_frame.xml deleted file mode 100644 index a59a2d04..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_frame.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_iframe.xml deleted file mode 100644 index a93899aa..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_iframe.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<iframe src="http://example.com/"> description</iframe> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_link.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_link.xml deleted file mode 100644 index 4db83dbe..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_link.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_meta.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_meta.xml deleted file mode 100644 index 42345e15..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_object.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_object.xml deleted file mode 100644 index f38dcb5f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_object.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onabort.xml deleted file mode 100644 index 97c86763..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onabort.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onblur.xml deleted file mode 100644 index 1bc3f830..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onblur.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onchange.xml deleted file mode 100644 index 553aa311..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onchange.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onclick.xml deleted file mode 100644 index b5d1d4e1..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onclick.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_ondblclick.xml deleted file mode 100644 index fc3a61a2..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_ondblclick.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onerror.xml deleted file mode 100644 index 60d46a18..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onerror.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onfocus.xml deleted file mode 100644 index 6f47ec69..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onfocus.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeydown.xml deleted file mode 100644 index 7eaa42c8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeydown.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeypress.xml deleted file mode 100644 index 8085f65d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeypress.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeyup.xml deleted file mode 100644 index 557422ee..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onkeyup.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onload.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onload.xml deleted file mode 100644 index 04323bce..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onload.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmousedown.xml deleted file mode 100644 index bb74f81c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmousedown.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseout.xml deleted file mode 100644 index 3c60df97..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseout.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseover.xml deleted file mode 100644 index f0732d05..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseover.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseup.xml deleted file mode 100644 index 8b28f6dc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onmouseup.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onreset.xml deleted file mode 100644 index 997cfc4b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onreset.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onresize.xml deleted file mode 100644 index 9a6a84e8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onresize.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onsubmit.xml deleted file mode 100644 index af6682fb..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onsubmit.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_onunload.xml deleted file mode 100644 index 6b1539dc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_onunload.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_script.xml deleted file mode 100644 index 3787017e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_base64.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_base64.xml deleted file mode 100644 index 61c013cc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_base64.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - -c2FmZTxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij5sb2NhdGlvbi5ocmVmPSdodHRwOi8n -KycvZXhhbXBsZS5jb20vJzs8L3NjcmlwdD4gZGVzY3JpcHRpb24= - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_cdata.xml deleted file mode 100644 index 055e3660..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_cdata.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -location.href='http:/'+'/example.com/'; description]]> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_inline.xml deleted file mode 100644 index 06d8ff9c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_inline.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -
safe description
-
-
\ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_map_description.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_map_description.xml deleted file mode 100644 index d3ffcc91..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_script_map_description.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_summary_style.xml b/lib/feedparser/tests/wellformed/sanitize/entry_summary_style.xml deleted file mode 100644 index 320de4e3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_summary_style.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_applet.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_applet.xml deleted file mode 100644 index 4a84cf71..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_applet.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<applet code="foo.class" codebase="http://www.example.com/"></applet> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_blink.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_blink.xml deleted file mode 100644 index d7c7618a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_blink.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<blink>safe</blink> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_crazy.xml deleted file mode 100644 index 4d6929a0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_crazy.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_embed.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_embed.xml deleted file mode 100644 index cc56f982..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_embed.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<embed src="http://www.example.com/"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_frame.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_frame.xml deleted file mode 100644 index eb5f80f9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_frame.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_iframe.xml deleted file mode 100644 index d3dd7b70..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_iframe.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<iframe src="http://www.example.com/"></iframe> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_link.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_link.xml deleted file mode 100644 index 28fa2fa9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_link.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_meta.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_meta.xml deleted file mode 100644 index c707fe2e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_meta.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_object.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_object.xml deleted file mode 100644 index 06ba3788..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_object.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onabort.xml deleted file mode 100644 index 6669690e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onabort.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onblur.xml deleted file mode 100644 index a5a09c9b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onblur.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onchange.xml deleted file mode 100644 index 9b5e22a4..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onchange.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onclick.xml deleted file mode 100644 index 1e7c20c2..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onclick.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_ondblclick.xml deleted file mode 100644 index 800904bb..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_ondblclick.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onerror.xml deleted file mode 100644 index d60cc44b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onerror.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onfocus.xml deleted file mode 100644 index b1218955..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onfocus.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeydown.xml deleted file mode 100644 index dfd3c227..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeydown.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeypress.xml deleted file mode 100644 index 5343e948..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeypress.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeyup.xml deleted file mode 100644 index 587d616d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onkeyup.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onload.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onload.xml deleted file mode 100644 index 7b71552d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onload.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onmousedown.xml deleted file mode 100644 index 69681fd9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmousedown.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseout.xml deleted file mode 100644 index fc25b8a8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseout.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseover.xml deleted file mode 100644 index 4dde5f37..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseover.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseup.xml deleted file mode 100644 index 81cfdfce..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onmouseup.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onreset.xml deleted file mode 100644 index e2bc481b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onreset.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onresize.xml deleted file mode 100644 index f96a76b2..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onresize.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onsubmit.xml deleted file mode 100644 index b07628ac..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onsubmit.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_onunload.xml deleted file mode 100644 index 0a6f998b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_onunload.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_script.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_script.xml deleted file mode 100644 index 86855886..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_script.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_script_cdata.xml deleted file mode 100644 index e315d623..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_script_cdata.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<![CDATA[safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description]]> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_script_inline.xml deleted file mode 100644 index 790cfd5c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_script_inline.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<div xmlns="http://www.w3.org/1999/xhtml">safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description</div> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/entry_title_style.xml b/lib/feedparser/tests/wellformed/sanitize/entry_title_style.xml deleted file mode 100644 index f1fb8d66..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/entry_title_style.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_applet.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_applet.xml deleted file mode 100644 index bc1aacb3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_applet.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<applet code="foo.class" codebase="http://www.example.com/"></applet> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_blink.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_blink.xml deleted file mode 100644 index 4018115f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_blink.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<blink>safe</blink> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_crazy.xml deleted file mode 100644 index 70ef93fc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_crazy.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_embed.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_embed.xml deleted file mode 100644 index 1e73ef5f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_embed.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<embed src="http://www.example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_frame.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_frame.xml deleted file mode 100644 index 4c6f8105..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_frame.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_iframe.xml deleted file mode 100644 index 3cefdfc5..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_iframe.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<iframe src="http://www.example.com/"></iframe> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_link.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_link.xml deleted file mode 100644 index 3cdec2e5..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_meta.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_meta.xml deleted file mode 100644 index 6974afb3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_meta.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_object.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_object.xml deleted file mode 100644 index 9beabb6b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_object.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onabort.xml deleted file mode 100644 index 264e99a5..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onabort.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onblur.xml deleted file mode 100644 index 0f39eba0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onblur.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onchange.xml deleted file mode 100644 index 8e33cb90..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onchange.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onclick.xml deleted file mode 100644 index 37eeb8a1..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_ondblclick.xml deleted file mode 100644 index c2636fed..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_ondblclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onerror.xml deleted file mode 100644 index 7f79e671..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onerror.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onfocus.xml deleted file mode 100644 index 73c97e0e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onfocus.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeydown.xml deleted file mode 100644 index f0a6fd24..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeydown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeypress.xml deleted file mode 100644 index 762819cd..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeypress.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeyup.xml deleted file mode 100644 index 3bb08dc0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onkeyup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onload.xml deleted file mode 100644 index 41078416..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmousedown.xml deleted file mode 100644 index 9d4f709a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmousedown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseout.xml deleted file mode 100644 index 008e9074..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseout.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseover.xml deleted file mode 100644 index b77c3912..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseover.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseup.xml deleted file mode 100644 index 5a5d42bf..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onmouseup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onreset.xml deleted file mode 100644 index 99062f47..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onreset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onresize.xml deleted file mode 100644 index b7b5e1a8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onresize.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onsubmit.xml deleted file mode 100644 index b09b8e8b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onsubmit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onunload.xml deleted file mode 100644 index 17aa1f34..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_onunload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script.xml deleted file mode 100644 index 842e93f2..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script_cdata.xml deleted file mode 100644 index 0113b7ef..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script_cdata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -location.href='http:/'+'/example.com/'; description]]> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script_inline.xml deleted file mode 100644 index fcae4f06..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_script_inline.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -
safe description
-
\ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_style.xml b/lib/feedparser/tests/wellformed/sanitize/feed_copyright_style.xml deleted file mode 100644 index a9dc4e5b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_copyright_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_applet.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_applet.xml deleted file mode 100644 index ed783f53..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_applet.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<applet code="foo.class" codebase="http://example.com/"></applet> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_blink.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_blink.xml deleted file mode 100644 index 0a94622b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_blink.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<blink>safe</blink> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_crazy.xml deleted file mode 100644 index b8bc995d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_crazy.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_embed.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_embed.xml deleted file mode 100644 index 82b0e3d4..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_embed.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<embed src="http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_frame.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_frame.xml deleted file mode 100644 index de61c2fc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_frame.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_iframe.xml deleted file mode 100644 index 49f1edc6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_iframe.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<iframe src="http://example.com/"> description</iframe> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_link.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_link.xml deleted file mode 100644 index 4ef66897..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_meta.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_meta.xml deleted file mode 100644 index 85ca4780..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_meta.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_object.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_object.xml deleted file mode 100644 index a32f5124..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_object.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onabort.xml deleted file mode 100644 index c6f2a96a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onabort.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onblur.xml deleted file mode 100644 index b10c4e8f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onblur.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onchange.xml deleted file mode 100644 index 653af579..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onchange.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onclick.xml deleted file mode 100644 index 93644d6d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_ondblclick.xml deleted file mode 100644 index 1776c913..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_ondblclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onerror.xml deleted file mode 100644 index 9b8dd9cf..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onerror.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onfocus.xml deleted file mode 100644 index 51a390bb..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onfocus.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeydown.xml deleted file mode 100644 index 4674d0e3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeydown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeypress.xml deleted file mode 100644 index cc2af96a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeypress.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeyup.xml deleted file mode 100644 index cde7c423..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onkeyup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onload.xml deleted file mode 100644 index 7763fbf3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onmousedown.xml deleted file mode 100644 index 45651554..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmousedown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseout.xml deleted file mode 100644 index e2de0c6c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseout.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseover.xml deleted file mode 100644 index 9e520079..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseover.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseup.xml deleted file mode 100644 index 15b0aac6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onmouseup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onreset.xml deleted file mode 100644 index be8bdc4c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onreset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onresize.xml deleted file mode 100644 index f2429be6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onresize.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onsubmit.xml deleted file mode 100644 index c230a400..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onsubmit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_onunload.xml deleted file mode 100644 index 9c66418c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_onunload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_script.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_script.xml deleted file mode 100644 index 34d20bd5..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_script.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_script_cdata.xml deleted file mode 100644 index ae3fb8e5..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_script_cdata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -location.href='http:/'+'/example.com/'; description]]> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_script_inline.xml deleted file mode 100644 index dafc46a7..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_script_inline.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -
safe description
-
\ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_info_style.xml b/lib/feedparser/tests/wellformed/sanitize/feed_info_style.xml deleted file mode 100644 index d1aac49a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_info_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_applet.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_applet.xml deleted file mode 100644 index 30d75af1..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_applet.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<applet code="foo.class" codebase="http://example.com/"></applet> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_blink.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_blink.xml deleted file mode 100644 index 89e14e36..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_blink.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<blink>safe</blink> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_crazy.xml deleted file mode 100644 index 2c286dd8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_crazy.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_embed.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_embed.xml deleted file mode 100644 index c83d6dab..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_embed.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<embed src="http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_frame.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_frame.xml deleted file mode 100644 index 0f165f0e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_frame.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_iframe.xml deleted file mode 100644 index f3c14bfc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_iframe.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<iframe src="http://example.com/"> description</iframe> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_link.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_link.xml deleted file mode 100644 index 2daccf30..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_meta.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_meta.xml deleted file mode 100644 index bb530e35..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_meta.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_object.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_object.xml deleted file mode 100644 index 4116bff8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_object.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onabort.xml deleted file mode 100644 index 597c482e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onabort.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onblur.xml deleted file mode 100644 index 5a1301f8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onblur.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onchange.xml deleted file mode 100644 index cec13dc7..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onchange.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onclick.xml deleted file mode 100644 index 18bd7a76..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_ondblclick.xml deleted file mode 100644 index b3e0fea5..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_ondblclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onerror.xml deleted file mode 100644 index 9693ee51..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onerror.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onfocus.xml deleted file mode 100644 index 315c8649..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onfocus.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeydown.xml deleted file mode 100644 index 8290367f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeydown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeypress.xml deleted file mode 100644 index 6def555e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeypress.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeyup.xml deleted file mode 100644 index 618a0c2f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onkeyup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onload.xml deleted file mode 100644 index 78a45b9e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmousedown.xml deleted file mode 100644 index 77010aae..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmousedown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseout.xml deleted file mode 100644 index 5e353ee0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseout.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseover.xml deleted file mode 100644 index 8d20666c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseover.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseup.xml deleted file mode 100644 index 4c689315..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onmouseup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onreset.xml deleted file mode 100644 index f7f2abae..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onreset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onresize.xml deleted file mode 100644 index eb7ebda0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onresize.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onsubmit.xml deleted file mode 100644 index 5bb7dd6b..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onsubmit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onunload.xml deleted file mode 100644 index 57824a3a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_onunload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script.xml deleted file mode 100644 index 59e76db1..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script_cdata.xml deleted file mode 100644 index b7ee3f4f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script_cdata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -location.href='http:/'+'/example.com/'; description]]> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script_inline.xml deleted file mode 100644 index 61c7c7b1..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_script_inline.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -
safe description
-
\ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_style.xml b/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_style.xml deleted file mode 100644 index 332a65b9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_subtitle_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_applet.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_applet.xml deleted file mode 100644 index 6bcca5d9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_applet.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<applet code="foo.class" codebase="http://example.com/"></applet> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_blink.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_blink.xml deleted file mode 100644 index cd758dd6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_blink.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<blink>safe</blink> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_crazy.xml deleted file mode 100644 index 63617d33..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_crazy.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_embed.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_embed.xml deleted file mode 100644 index 68fca0f0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_embed.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<embed src="http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_frame.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_frame.xml deleted file mode 100644 index 9a3a14fb..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_frame.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_iframe.xml deleted file mode 100644 index 6863469c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_iframe.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<iframe src="http://example.com/"></iframe> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_link.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_link.xml deleted file mode 100644 index f46ac8e7..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_meta.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_meta.xml deleted file mode 100644 index 21efed77..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_meta.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_object.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_object.xml deleted file mode 100644 index 114c6256..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_object.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onabort.xml deleted file mode 100644 index a4ce8001..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onabort.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onblur.xml deleted file mode 100644 index 2f2958e9..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onblur.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onchange.xml deleted file mode 100644 index 2afe2267..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onchange.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onclick.xml deleted file mode 100644 index fa104ca6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_ondblclick.xml deleted file mode 100644 index 6b72d9fa..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_ondblclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onerror.xml deleted file mode 100644 index 3744e11d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onerror.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onfocus.xml deleted file mode 100644 index a11a3030..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onfocus.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeydown.xml deleted file mode 100644 index 46ddf0ca..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeydown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeypress.xml deleted file mode 100644 index 5703a1fc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeypress.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeyup.xml deleted file mode 100644 index dc78e672..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onkeyup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onload.xml deleted file mode 100644 index 97265537..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmousedown.xml deleted file mode 100644 index a25f3f21..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmousedown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseout.xml deleted file mode 100644 index ef7c5063..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseout.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseover.xml deleted file mode 100644 index aac3d54e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseover.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseup.xml deleted file mode 100644 index 41ab39e7..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onmouseup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onreset.xml deleted file mode 100644 index 17932f36..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onreset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onresize.xml deleted file mode 100644 index bf712f87..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onresize.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onsubmit.xml deleted file mode 100644 index a33ebf45..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onsubmit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onunload.xml deleted file mode 100644 index 2d155055..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_onunload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script.xml deleted file mode 100644 index b818be55..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_cdata.xml deleted file mode 100644 index 943c8d61..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_cdata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -location.href='http:/'+'/example.com/'; description]]> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_inline.xml deleted file mode 100644 index 90294651..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_inline.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -
safe description
-
\ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_map_description.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_map_description.xml deleted file mode 100644 index fb9d0ef6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_script_map_description.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_style.xml b/lib/feedparser/tests/wellformed/sanitize/feed_tagline_style.xml deleted file mode 100644 index abc68f35..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_tagline_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_applet.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_applet.xml deleted file mode 100644 index 7d6156bc..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_applet.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<applet code="foo.class" codebase="http://example.com/"></applet> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_blink.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_blink.xml deleted file mode 100644 index e9fb536c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_blink.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<blink>safe</blink> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_crazy.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_crazy.xml deleted file mode 100644 index dfca8a2c..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_crazy.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Crazy HTML -- Can Your Regex Parse This?</title> - -</head> -<body notRealAttribute="value"onload="executeMe();"foo="bar" - -> -<!-- <script> --> - -<!-- - <script> ---> - -</script> - - -<script - - -> - -function executeMe() -{ - - - - -/* <script> -function am_i_javascript() -{ - var str = "Some innocuously commented out stuff"; -} -< /script> -*/ - - - - - - - - - - alert("Executed"); -} - - </script - - - -> -<h1>Did The Javascript Execute?</h1> -<div notRealAttribute="value -"onmouseover=" -executeMe(); -"foo="bar"> -I will execute here, too, if you mouse over me -</div> - -</body> - -</html> - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_embed.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_embed.xml deleted file mode 100644 index 0ae3167d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_embed.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<embed src="http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_frame.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_frame.xml deleted file mode 100644 index c6df6c00..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_frame.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<frameset rows="*"><frame src="http://example.com/"></frameset> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_iframe.xml deleted file mode 100644 index 9422d368..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_iframe.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<iframe src="http://example.com/"></iframe> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_link.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_link.xml deleted file mode 100644 index d540cc41..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_link.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<link rel="stylesheet" type="text/css" href="http://example.com/evil.css"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_meta.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_meta.xml deleted file mode 100644 index 801c4df3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_meta.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<meta http-equiv="Refresh" content="0; URL=http://example.com/"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_object.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_object.xml deleted file mode 100644 index 312cc841..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_object.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC"> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onabort.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onabort.xml deleted file mode 100644 index 36f5e913..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onabort.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onabort="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onblur.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onblur.xml deleted file mode 100644 index dbf5f3af..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onblur.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onblur="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onchange.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onchange.xml deleted file mode 100644 index 26ba2385..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onchange.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onchange="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onclick.xml deleted file mode 100644 index 76be05c8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_ondblclick.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_ondblclick.xml deleted file mode 100644 index 69df1cd2..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_ondblclick.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" ondblclick="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onerror.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onerror.xml deleted file mode 100644 index 254a630a..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onerror.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onerror="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onfocus.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onfocus.xml deleted file mode 100644 index 0f2cfa7e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onfocus.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onfocus="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeydown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeydown.xml deleted file mode 100644 index 66577130..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeydown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeydown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeypress.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeypress.xml deleted file mode 100644 index dc3e3bd4..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeypress.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeypress="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeyup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeyup.xml deleted file mode 100644 index 5f2e98a4..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onkeyup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onkeyup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onload.xml deleted file mode 100644 index 066a375e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmousedown.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onmousedown.xml deleted file mode 100644 index a4a9281d..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmousedown.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmousedown="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseout.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseout.xml deleted file mode 100644 index 6edc7e3e..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseout.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseout="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseover.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseover.xml deleted file mode 100644 index 6da205b8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseover.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseover="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseup.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseup.xml deleted file mode 100644 index b7693102..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onmouseup.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onmouseup="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onreset.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onreset.xml deleted file mode 100644 index cd3422e2..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onreset.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onreset="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onresize.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onresize.xml deleted file mode 100644 index 9d6bcee7..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onresize.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onresize="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onsubmit.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onsubmit.xml deleted file mode 100644 index 153d6f2f..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onsubmit.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onsubmit="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_onunload.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_onunload.xml deleted file mode 100644 index 77866f89..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_onunload.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<img src="http://www.ragingplatypus.com/i/cam-full.jpg" onunload="location.href='http://www.ragingplatypus.com/';" /> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_script.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_script.xml deleted file mode 100644 index 63284163..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_script.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_script_cdata.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_script_cdata.xml deleted file mode 100644 index a37085f3..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_script_cdata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<![CDATA[safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description]]> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_script_inline.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_script_inline.xml deleted file mode 100644 index 889667e6..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_script_inline.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<div xmlns="http://www.w3.org/1999/xhtml">safe<script type="text/javascript">location.href='http:/'+'/example.com/';</script> description</div> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_style.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_style.xml deleted file mode 100644 index c1aeaec8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_style.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -<a href="http://www.ragingplatypus.com/" style="display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;">never trust your upstream platypus</a> - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/feed_title_unacceptable_uri.xml b/lib/feedparser/tests/wellformed/sanitize/feed_title_unacceptable_uri.xml deleted file mode 100644 index 7d66c5a8..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/feed_title_unacceptable_uri.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - <a href="javascript:alert(1)">safe</a> - diff --git a/lib/feedparser/tests/wellformed/sanitize/item_body_applet.xml b/lib/feedparser/tests/wellformed/sanitize/item_body_applet.xml deleted file mode 100644 index 10dea8b0..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/item_body_applet.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -safe description - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/item_body_blink.xml b/lib/feedparser/tests/wellformed/sanitize/item_body_blink.xml deleted file mode 100644 index b570ff20..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/item_body_blink.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -safe description - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/item_body_embed.xml b/lib/feedparser/tests/wellformed/sanitize/item_body_embed.xml deleted file mode 100644 index 2f2a2db1..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/item_body_embed.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -safe description - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/item_body_frame.xml b/lib/feedparser/tests/wellformed/sanitize/item_body_frame.xml deleted file mode 100644 index 7228ecfb..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/item_body_frame.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -safe description - - - \ No newline at end of file diff --git a/lib/feedparser/tests/wellformed/sanitize/item_body_iframe.xml b/lib/feedparser/tests/wellformed/sanitize/item_body_iframe.xml deleted file mode 100644 index 561fe312..00000000 --- a/lib/feedparser/tests/wellformed/sanitize/item_body_iframe.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -safe