Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Lib/test/test_pyexpat.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def _verify_parse_output(self, operations):
for operation, expected_operation in zip(operations, expected_operations):
self.assertEqual(operation, expected_operation)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_parse_bytes(self):
out = self.Outputter()
parser = expat.ParserCreate(namespace_separator='!')
Expand Down Expand Up @@ -276,7 +275,6 @@ def test_parse_again(self):
expat.errors.XML_ERROR_FINISHED)

class NamespaceSeparatorTest(unittest.TestCase):
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_legal(self):
# Tests that make sure we get errors when the namespace_separator value
# is illegal, and that we don't for good values:
Expand Down Expand Up @@ -409,29 +407,25 @@ def test2(self):
self.assertEqual(self.stuff, ["1<2> \n 3"],
"buffered text not properly collapsed")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test3(self):
self.setHandlers(["StartElementHandler"])
self.parser.Parse(b"<a>1<b/>2<c/>3</a>", True)
self.assertEqual(self.stuff, ["<a>", "1", "<b>", "2", "<c>", "3"],
"buffered text not properly split")

@unittest.expectedFailure # TODO: RUSTPYTHON
def test4(self):
self.setHandlers(["StartElementHandler", "EndElementHandler"])
self.parser.CharacterDataHandler = None
self.parser.Parse(b"<a>1<b/>2<c/>3</a>", True)
self.assertEqual(self.stuff,
["<a>", "<b>", "</b>", "<c>", "</c>", "</a>"])

@unittest.expectedFailure # TODO: RUSTPYTHON
def test5(self):
self.setHandlers(["StartElementHandler", "EndElementHandler"])
self.parser.Parse(b"<a>1<b></b>2<c/>3</a>", True)
self.assertEqual(self.stuff,
["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3", "</a>"])

@unittest.expectedFailure # TODO: RUSTPYTHON
def test6(self):
self.setHandlers(["CommentHandler", "EndElementHandler",
"StartElementHandler"])
Expand Down Expand Up @@ -529,7 +523,6 @@ def check_pos(self, event):
'Expected position %s, got position %s' %(pos, expected))
self.upto += 1

@unittest.expectedFailure # TODO: RUSTPYTHON
def test(self):
self.parser = expat.ParserCreate()
self.parser.StartElementHandler = self.StartElementHandler
Expand Down
4 changes: 0 additions & 4 deletions Lib/test/test_xml_dom_xmlbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def test_builder(self):
builder = imp.createDOMBuilder(imp.MODE_SYNCHRONOUS, None)
self.assertIsInstance(builder, xmlbuilder.DOMBuilder)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_parse_uri(self):
body = (
b"HTTP/1.1 200 OK\r\nContent-Type: text/xml; charset=utf-8\r\n\r\n"
Expand All @@ -74,8 +72,6 @@ def test_parse_uri(self):
self.assertIsInstance(document, minidom.Document)
self.assertEqual(len(document.childNodes), 1)

# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_parse_with_systemId(self):
response = io.BytesIO(SMALL_SAMPLE)

Expand Down
38 changes: 0 additions & 38 deletions Lib/test/test_xmlrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@

class XMLRPCTestCase(unittest.TestCase):

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_dump_load(self):
dump = xmlrpclib.dumps((alist,))
load = xmlrpclib.loads(dump)
self.assertEqual(alist, load[0][0])

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_dump_bare_datetime(self):
# This checks that an unwrapped datetime.date object can be handled
# by the marshalling code. This can't be done via test_dump_load()
Expand Down Expand Up @@ -88,7 +86,6 @@ def test_dump_bare_datetime(self):
self.assertIsNone(m)


@unittest.expectedFailure # TODO: RUSTPYTHON
def test_datetime_before_1900(self):
# same as before but with a date before 1900
dt = datetime.datetime(1, 2, 10, 11, 41, 23)
Expand All @@ -107,7 +104,6 @@ def test_datetime_before_1900(self):
self.assertIs(type(newdt), xmlrpclib.DateTime)
self.assertIsNone(m)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_bug_1164912 (self):
d = xmlrpclib.DateTime()
((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,),
Expand All @@ -118,7 +114,6 @@ def test_bug_1164912 (self):
s = xmlrpclib.dumps((new_d,), methodresponse=True)
self.assertIsInstance(s, str)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_newstyle_class(self):
class T(object):
pass
Expand Down Expand Up @@ -184,7 +179,6 @@ def dummy_write(s):
m.dump_double(xmlrpclib.MAXINT + 42, dummy_write)
m.dump_double(xmlrpclib.MININT - 42, dummy_write)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_dump_none(self):
value = alist + [None]
arg1 = (alist + [None],)
Expand Down Expand Up @@ -215,7 +209,6 @@ def test_dump_encoding(self):
self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
self.assertEqual(xmlrpclib.loads(strg)[1], methodname)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_dump_bytes(self):
sample = b"my dog has fleas"
self.assertEqual(sample, xmlrpclib.Binary(sample))
Expand Down Expand Up @@ -258,7 +251,6 @@ def check_loads(self, s, value, **kwargs):
self.assertIs(type(newvalue), type(value))
self.assertIsNone(m)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_load_standard_types(self):
check = self.check_loads
check('string', 'string')
Expand Down Expand Up @@ -300,7 +292,6 @@ def test_load_extension_types(self):
check('<bigdecimal>9876543210.0123456789</bigdecimal>',
decimal.Decimal('9876543210.0123456789'))

@unittest.expectedFailure # TODO: RUSTPYTHON; NameError: name 'expat' is not defined
def test_limit_int(self):
check = self.check_loads
maxdigits = 5000
Expand Down Expand Up @@ -332,7 +323,6 @@ def test_ssl_presence(self):
except OSError:
self.assertTrue(has_ssl)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_keepalive_disconnect(self):
class RequestHandler(http.server.BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
Expand Down Expand Up @@ -472,7 +462,6 @@ def test_repr(self):
self.assertEqual(repr(f), "<Fault 42: 'Test Fault'>")
self.assertEqual(repr(f), str(f))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_dump_fault(self):
f = xmlrpclib.Fault(42, 'Test Fault')
s = xmlrpclib.dumps((f,))
Expand Down Expand Up @@ -820,7 +809,6 @@ def tearDown(self):
xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = False

class SimpleServerTestCase(BaseServerTestCase):
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_simple1(self):
try:
p = xmlrpclib.ServerProxy(URL)
Expand All @@ -831,7 +819,6 @@ def test_simple1(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_nonascii(self):
start_string = 'P\N{LATIN SMALL LETTER Y WITH CIRCUMFLEX}t'
end_string = 'h\N{LATIN SMALL LETTER O WITH HORN}n'
Expand Down Expand Up @@ -860,7 +847,6 @@ def test_client_encoding(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_nonascii_methodname(self):
try:
p = xmlrpclib.ServerProxy(URL, encoding='ascii')
Expand All @@ -881,7 +867,6 @@ def test_404(self):
self.assertEqual(response.status, 404)
self.assertEqual(response.reason, 'Not Found')

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_introspection1(self):
expected_methods = set(['pow', 'div', 'my_function', 'add', 'têšt',
'system.listMethods', 'system.methodHelp',
Expand All @@ -898,7 +883,6 @@ def test_introspection1(self):
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))


@unittest.expectedFailure # TODO: RUSTPYTHON
def test_introspection2(self):
try:
# test _methodHelp()
Expand All @@ -911,7 +895,6 @@ def test_introspection2(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
@make_request_and_skipIf(sys.flags.optimize >= 2,
"Docstrings are omitted with -O2 and above")
def test_introspection3(self):
Expand All @@ -926,7 +909,6 @@ def test_introspection3(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_introspection4(self):
# the SimpleXMLRPCServer doesn't support signatures, but
# at least check that we can try making the call
Expand All @@ -940,7 +922,6 @@ def test_introspection4(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_multicall(self):
try:
p = xmlrpclib.ServerProxy(URL)
Expand All @@ -958,7 +939,6 @@ def test_multicall(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_non_existing_multicall(self):
try:
p = xmlrpclib.ServerProxy(URL)
Expand All @@ -980,7 +960,6 @@ def test_non_existing_multicall(self):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_dotted_attribute(self):
# Raises an AttributeError because private methods are not allowed.
self.assertRaises(AttributeError,
Expand All @@ -991,14 +970,12 @@ def test_dotted_attribute(self):
# This avoids waiting for the socket timeout.
self.test_simple1()

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_allow_dotted_names_true(self):
# XXX also need allow_dotted_names_false test.
server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
data = server.Fixture.getData()
self.assertEqual(data, '42')

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_unicode_host(self):
server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
self.assertEqual(server.add("a", "\xe9"), "a\xe9")
Expand All @@ -1013,7 +990,6 @@ def test_partial_post(self):
'Accept-Encoding: identity\r\n'
'Content-Length: 0\r\n\r\n'.encode('ascii'))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_context_manager(self):
with xmlrpclib.ServerProxy(URL) as server:
server.add(2, 3)
Expand All @@ -1022,7 +998,6 @@ def test_context_manager(self):
self.assertEqual(server('transport')._connection,
(None, None))

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_context_manager_method_error(self):
try:
with xmlrpclib.ServerProxy(URL) as server:
Expand Down Expand Up @@ -1057,13 +1032,11 @@ def test_server_encoding(self):
class MultiPathServerTestCase(BaseServerTestCase):
threadFunc = staticmethod(http_multi_server)
request_count = 2
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_path1(self):
p = xmlrpclib.ServerProxy(URL+"/foo")
self.assertEqual(p.pow(6,8), 6**8)
self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_path2(self):
p = xmlrpclib.ServerProxy(URL+"/foo/bar")
self.assertEqual(p.add(6,8), 6+8)
Expand Down Expand Up @@ -1151,7 +1124,6 @@ def setUp(self):
#A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
#does indeed serve subsequent requests on the same connection
class KeepaliveServerTestCase1(BaseKeepaliveServerTestCase):
@unittest.expectedFailure # TODO: RUSTPYTHON
def test_two(self):
p = xmlrpclib.ServerProxy(URL)
#do three requests.
Expand Down Expand Up @@ -1235,7 +1207,6 @@ def send_content(self, connection, body):
def setUp(self):
BaseServerTestCase.setUp(self)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_gzip_request(self):
t = self.Transport()
t.encode_threshold = None
Expand All @@ -1259,7 +1230,6 @@ def test_bad_gzip_request(self):
p.pow(6, 8)
p("close")()

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_gzip_response(self):
t = self.Transport()
p = xmlrpclib.ServerProxy(URL, transport=t)
Expand Down Expand Up @@ -1318,15 +1288,13 @@ def assertContainsAdditionalHeaders(self, headers, additional):
for key, value in additional.items():
self.assertEqual(headers.get(key), value)

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_header(self):
p = xmlrpclib.ServerProxy(URL, headers=[('X-Test', 'foo')])
self.assertEqual(p.pow(6, 8), 6**8)

headers = self.RequestHandler.test_headers
self.assertContainsAdditionalHeaders(headers, {'X-Test': 'foo'})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_header_many(self):
p = xmlrpclib.ServerProxy(
URL, headers=[('X-Test', 'foo'), ('X-Test-Second', 'bar')])
Expand All @@ -1336,23 +1304,20 @@ def test_header_many(self):
self.assertContainsAdditionalHeaders(
headers, {'X-Test': 'foo', 'X-Test-Second': 'bar'})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_header_empty(self):
p = xmlrpclib.ServerProxy(URL, headers=[])
self.assertEqual(p.pow(6, 8), 6**8)

headers = self.RequestHandler.test_headers
self.assertContainsAdditionalHeaders(headers, {})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_header_tuple(self):
p = xmlrpclib.ServerProxy(URL, headers=(('X-Test', 'foo'),))
self.assertEqual(p.pow(6, 8), 6**8)

headers = self.RequestHandler.test_headers
self.assertContainsAdditionalHeaders(headers, {'X-Test': 'foo'})

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_header_items(self):
p = xmlrpclib.ServerProxy(URL, headers={'X-Test': 'foo'}.items())
self.assertEqual(p.pow(6, 8), 6**8)
Expand Down Expand Up @@ -1411,7 +1376,6 @@ def tearDown(self):
default_class = http.client.HTTPMessage
xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = default_class

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_basic(self):
# check that flag is false by default
flagval = xmlrpc.server.SimpleXMLRPCServer._send_traceback_header
Expand Down Expand Up @@ -1506,7 +1470,6 @@ def test_cgi_get(self):
self.assertEqual(message, 'Bad Request')


@unittest.expectedFailure # TODO: RUSTPYTHON
def test_cgi_xmlrpc_response(self):
data = """<?xml version='1.0'?>
<methodCall>
Expand Down Expand Up @@ -1552,7 +1515,6 @@ def test_cgi_xmlrpc_response(self):

class UseBuiltinTypesTestCase(unittest.TestCase):

@unittest.expectedFailure # TODO: RUSTPYTHON
def test_use_builtin_types(self):
# SimpleXMLRPCDispatcher.__init__ accepts use_builtin_types, which
# makes all dispatch of binary data as bytes instances, and all
Expand Down
3 changes: 1 addition & 2 deletions Lib/xmlrpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@
from decimal import Decimal
import http.client
import urllib.parse
# XXX RUSTPYTHON TODO: pyexpat
# from xml.parsers import expat
from xml.parsers import expat
import errno
from io import BytesIO
try:
Expand Down
Loading
Loading