mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Mark erroring/failing tests
This commit is contained in:
1 file changed
+86
@@ -41,11 +41,15 @@ alist = [{'astring': 'foo@bar.baz.spam',
|
||||
|
||||
class XMLRPCTestCase(unittest.TestCase):
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dump_load(self):
|
||||
dump = xmlrpclib.dumps((alist,))
|
||||
load = xmlrpclib.loads(dump)
|
||||
self.assertEqual(alist, load[0][0])
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
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()
|
||||
@@ -80,6 +84,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
self.assertIsNone(m)
|
||||
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_datetime_before_1900(self):
|
||||
# same as before but with a date before 1900
|
||||
dt = datetime.datetime(1, 2, 10, 11, 41, 23)
|
||||
@@ -98,6 +104,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
self.assertIs(type(newdt), xmlrpclib.DateTime)
|
||||
self.assertIsNone(m)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_bug_1164912 (self):
|
||||
d = xmlrpclib.DateTime()
|
||||
((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,),
|
||||
@@ -108,6 +116,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
s = xmlrpclib.dumps((new_d,), methodresponse=True)
|
||||
self.assertIsInstance(s, str)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_newstyle_class(self):
|
||||
class T(object):
|
||||
pass
|
||||
@@ -173,6 +183,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
m.dump_double(xmlrpclib.MAXINT + 42, dummy_write)
|
||||
m.dump_double(xmlrpclib.MININT - 42, dummy_write)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dump_none(self):
|
||||
value = alist + [None]
|
||||
arg1 = (alist + [None],)
|
||||
@@ -181,6 +193,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
xmlrpclib.loads(strg)[0][0])
|
||||
self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dump_encoding(self):
|
||||
value = {'key\u20ac\xa4':
|
||||
'value\u20ac\xa4'}
|
||||
@@ -202,6 +216,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
self.assertEqual(xmlrpclib.loads(strg)[0][0], value)
|
||||
self.assertEqual(xmlrpclib.loads(strg)[1], methodname)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dump_bytes(self):
|
||||
sample = b"my dog has fleas"
|
||||
self.assertEqual(sample, xmlrpclib.Binary(sample))
|
||||
@@ -221,6 +237,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
self.assertIs(type(newvalue), xmlrpclib.Binary)
|
||||
self.assertIsNone(m)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_loads_unsupported(self):
|
||||
ResponseError = xmlrpclib.ResponseError
|
||||
data = '<params><param><value><spam/></value></param></params>'
|
||||
@@ -243,6 +261,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
self.assertIs(type(newvalue), type(value))
|
||||
self.assertIsNone(m)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_load_standard_types(self):
|
||||
check = self.check_loads
|
||||
check('string', 'string')
|
||||
@@ -270,6 +290,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
'<member><name>a</name><value><int>1</int></value></member>'
|
||||
'</struct>', {'a': 1, 'b': 2})
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_load_extension_types(self):
|
||||
check = self.check_loads
|
||||
check('<nil/>', None)
|
||||
@@ -304,6 +326,8 @@ class XMLRPCTestCase(unittest.TestCase):
|
||||
except OSError:
|
||||
self.assertTrue(has_ssl)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_keepalive_disconnect(self):
|
||||
class RequestHandler(http.server.BaseHTTPRequestHandler):
|
||||
protocol_version = "HTTP/1.1"
|
||||
@@ -443,6 +467,8 @@ class FaultTestCase(unittest.TestCase):
|
||||
self.assertEqual(repr(f), "<Fault 42: 'Test Fault'>")
|
||||
self.assertEqual(repr(f), str(f))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dump_fault(self):
|
||||
f = xmlrpclib.Fault(42, 'Test Fault')
|
||||
s = xmlrpclib.dumps((f,))
|
||||
@@ -771,6 +797,8 @@ class BaseServerTestCase(unittest.TestCase):
|
||||
xmlrpc.server.SimpleXMLRPCServer._send_traceback_header = False
|
||||
|
||||
class SimpleServerTestCase(BaseServerTestCase):
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_simple1(self):
|
||||
try:
|
||||
p = xmlrpclib.ServerProxy(URL)
|
||||
@@ -781,6 +809,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
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'
|
||||
@@ -794,6 +824,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_client_encoding(self):
|
||||
start_string = '\u20ac'
|
||||
end_string = '\xa4'
|
||||
@@ -808,6 +840,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_nonascii_methodname(self):
|
||||
try:
|
||||
p = xmlrpclib.ServerProxy(URL, encoding='ascii')
|
||||
@@ -828,6 +862,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
self.assertEqual(response.status, 404)
|
||||
self.assertEqual(response.reason, 'Not Found')
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_introspection1(self):
|
||||
expected_methods = set(['pow', 'div', 'my_function', 'add', 'têšt',
|
||||
'system.listMethods', 'system.methodHelp',
|
||||
@@ -844,6 +880,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_introspection2(self):
|
||||
try:
|
||||
# test _methodHelp()
|
||||
@@ -856,6 +894,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
@make_request_and_skipIf(sys.flags.optimize >= 2,
|
||||
"Docstrings are omitted with -O2 and above")
|
||||
def test_introspection3(self):
|
||||
@@ -870,6 +910,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_introspection4(self):
|
||||
# the SimpleXMLRPCServer doesn't support signatures, but
|
||||
# at least check that we can try making the call
|
||||
@@ -883,6 +925,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_multicall(self):
|
||||
try:
|
||||
p = xmlrpclib.ServerProxy(URL)
|
||||
@@ -900,6 +944,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_non_existing_multicall(self):
|
||||
try:
|
||||
p = xmlrpclib.ServerProxy(URL)
|
||||
@@ -921,6 +967,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# protocol error; provide additional information in test output
|
||||
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_dotted_attribute(self):
|
||||
# Raises an AttributeError because private methods are not allowed.
|
||||
self.assertRaises(AttributeError,
|
||||
@@ -931,12 +979,16 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
# This avoids waiting for the socket timeout.
|
||||
self.test_simple1()
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
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')
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_unicode_host(self):
|
||||
server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
|
||||
self.assertEqual(server.add("a", "\xe9"), "a\xe9")
|
||||
@@ -951,6 +1003,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
'Accept-Encoding: identity\r\n'
|
||||
'Content-Length: 0\r\n\r\n'.encode('ascii'))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_context_manager(self):
|
||||
with xmlrpclib.ServerProxy(URL) as server:
|
||||
server.add(2, 3)
|
||||
@@ -959,6 +1013,8 @@ class SimpleServerTestCase(BaseServerTestCase):
|
||||
self.assertEqual(server('transport')._connection,
|
||||
(None, None))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_context_manager_method_error(self):
|
||||
try:
|
||||
with xmlrpclib.ServerProxy(URL) as server:
|
||||
@@ -974,6 +1030,8 @@ class SimpleServerEncodingTestCase(BaseServerTestCase):
|
||||
def threadFunc(evt, numrequests, requestHandler=None, encoding=None):
|
||||
http_server(evt, numrequests, requestHandler, 'iso-8859-15')
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_server_encoding(self):
|
||||
start_string = '\u20ac'
|
||||
end_string = '\xa4'
|
||||
@@ -992,16 +1050,22 @@ class SimpleServerEncodingTestCase(BaseServerTestCase):
|
||||
class MultiPathServerTestCase(BaseServerTestCase):
|
||||
threadFunc = staticmethod(http_multi_server)
|
||||
request_count = 2
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
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)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_path2(self):
|
||||
p = xmlrpclib.ServerProxy(URL+"/foo/bar")
|
||||
self.assertEqual(p.add(6,8), 6+8)
|
||||
self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_path3(self):
|
||||
p = xmlrpclib.ServerProxy(URL+"/is/broken")
|
||||
self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
|
||||
@@ -1033,6 +1097,8 @@ class BaseKeepaliveServerTestCase(BaseServerTestCase):
|
||||
#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):
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_two(self):
|
||||
p = xmlrpclib.ServerProxy(URL)
|
||||
#do three requests.
|
||||
@@ -1116,6 +1182,8 @@ class GzipServerTestCase(BaseServerTestCase):
|
||||
def setUp(self):
|
||||
BaseServerTestCase.setUp(self)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_gzip_request(self):
|
||||
t = self.Transport()
|
||||
t.encode_threshold = None
|
||||
@@ -1139,6 +1207,8 @@ class GzipServerTestCase(BaseServerTestCase):
|
||||
p.pow(6, 8)
|
||||
p("close")()
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_gzip_response(self):
|
||||
t = self.Transport()
|
||||
p = xmlrpclib.ServerProxy(URL, transport=t)
|
||||
@@ -1197,6 +1267,8 @@ class HeadersServerTestCase(BaseServerTestCase):
|
||||
for key, value in additional.items():
|
||||
self.assertEqual(headers.get(key), value)
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_header(self):
|
||||
p = xmlrpclib.ServerProxy(URL, headers=[('X-Test', 'foo')])
|
||||
self.assertEqual(p.pow(6, 8), 6**8)
|
||||
@@ -1204,6 +1276,8 @@ class HeadersServerTestCase(BaseServerTestCase):
|
||||
headers = self.RequestHandler.test_headers
|
||||
self.assertContainsAdditionalHeaders(headers, {'X-Test': 'foo'})
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_header_many(self):
|
||||
p = xmlrpclib.ServerProxy(
|
||||
URL, headers=[('X-Test', 'foo'), ('X-Test-Second', 'bar')])
|
||||
@@ -1213,6 +1287,8 @@ class HeadersServerTestCase(BaseServerTestCase):
|
||||
self.assertContainsAdditionalHeaders(
|
||||
headers, {'X-Test': 'foo', 'X-Test-Second': 'bar'})
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_header_empty(self):
|
||||
p = xmlrpclib.ServerProxy(URL, headers=[])
|
||||
self.assertEqual(p.pow(6, 8), 6**8)
|
||||
@@ -1220,6 +1296,8 @@ class HeadersServerTestCase(BaseServerTestCase):
|
||||
headers = self.RequestHandler.test_headers
|
||||
self.assertContainsAdditionalHeaders(headers, {})
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_header_tuple(self):
|
||||
p = xmlrpclib.ServerProxy(URL, headers=(('X-Test', 'foo'),))
|
||||
self.assertEqual(p.pow(6, 8), 6**8)
|
||||
@@ -1227,6 +1305,8 @@ class HeadersServerTestCase(BaseServerTestCase):
|
||||
headers = self.RequestHandler.test_headers
|
||||
self.assertContainsAdditionalHeaders(headers, {'X-Test': 'foo'})
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_header_items(self):
|
||||
p = xmlrpclib.ServerProxy(URL, headers={'X-Test': 'foo'}.items())
|
||||
self.assertEqual(p.pow(6, 8), 6**8)
|
||||
@@ -1285,6 +1365,8 @@ class FailingServerTestCase(unittest.TestCase):
|
||||
default_class = http.client.HTTPMessage
|
||||
xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = default_class
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_basic(self):
|
||||
# check that flag is false by default
|
||||
flagval = xmlrpc.server.SimpleXMLRPCServer._send_traceback_header
|
||||
@@ -1379,6 +1461,8 @@ class CGIHandlerTestCase(unittest.TestCase):
|
||||
self.assertEqual(message, 'Bad Request')
|
||||
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_cgi_xmlrpc_response(self):
|
||||
data = """<?xml version='1.0'?>
|
||||
<methodCall>
|
||||
@@ -1424,6 +1508,8 @@ class CGIHandlerTestCase(unittest.TestCase):
|
||||
|
||||
class UseBuiltinTypesTestCase(unittest.TestCase):
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_use_builtin_types(self):
|
||||
# SimpleXMLRPCDispatcher.__init__ accepts use_builtin_types, which
|
||||
# makes all dispatch of binary data as bytes instances, and all
|
||||
|
||||
Reference in new issue
Block a user