mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: Remove deprecated stubs for points-to tests
I grep'ed through all our options files, and couldn't find any tests
that relies on these anymore 👍
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
|
||||
def new(*args):
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
def new(*args):
|
||||
pass
|
||||
@@ -1 +0,0 @@
|
||||
__all__ = ['AES', 'ARC4']
|
||||
@@ -1,2 +0,0 @@
|
||||
def generate(bits):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def generate(bits):
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
class Template:
|
||||
def __init__(self, content, filename="<string>"):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def decodestring(s):
|
||||
return None
|
||||
@@ -1,69 +0,0 @@
|
||||
|
||||
class Bottle(object):
|
||||
|
||||
def route(self, path=None, method='GET', **options):
|
||||
pass
|
||||
|
||||
def get(self, path=None, method='GET', **options):
|
||||
""" Equals :meth:`route`. """
|
||||
return self.route(path, method, **options)
|
||||
|
||||
def post(self, path=None, method='POST', **options):
|
||||
""" Equals :meth:`route` with a ``POST`` method parameter. """
|
||||
return self.route(path, method, **options)
|
||||
|
||||
def put(self, path=None, method='PUT', **options):
|
||||
""" Equals :meth:`route` with a ``PUT`` method parameter. """
|
||||
return self.route(path, method, **options)
|
||||
|
||||
def delete(self, path=None, method='DELETE', **options):
|
||||
""" Equals :meth:`route` with a ``DELETE`` method parameter. """
|
||||
return self.route(path, method, **options)
|
||||
|
||||
def error(self, code=500):
|
||||
""" Decorator: Register an output handler for a HTTP error code"""
|
||||
def wrapper(handler):
|
||||
self.error_handler[int(code)] = handler
|
||||
return handler
|
||||
return wrapper
|
||||
|
||||
#Use same wrapper logic as the original `bottle` code.
|
||||
|
||||
def make_default_app_wrapper(name):
|
||||
""" Return a callable that relays calls to the current default app. """
|
||||
|
||||
@functools.wraps(getattr(Bottle, name))
|
||||
def wrapper(*a, **ka):
|
||||
return getattr(app(), name)(*a, **ka)
|
||||
|
||||
return wrapper
|
||||
|
||||
route = make_default_app_wrapper('route')
|
||||
get = make_default_app_wrapper('get')
|
||||
post = make_default_app_wrapper('post')
|
||||
put = make_default_app_wrapper('put')
|
||||
delete = make_default_app_wrapper('delete')
|
||||
patch = make_default_app_wrapper('patch')
|
||||
error = make_default_app_wrapper('error')
|
||||
mount = make_default_app_wrapper('mount')
|
||||
hook = make_default_app_wrapper('hook')
|
||||
install = make_default_app_wrapper('install')
|
||||
uninstall = make_default_app_wrapper('uninstall')
|
||||
url = make_default_app_wrapper('get_url')
|
||||
|
||||
class LocalProxy(object):
|
||||
pass
|
||||
|
||||
class LocalRequest(LocalProxy):
|
||||
pass
|
||||
|
||||
class LocalResponse(LocalProxy):
|
||||
pass
|
||||
|
||||
|
||||
request = LocalRequest()
|
||||
response = LocalResponse()
|
||||
|
||||
|
||||
def redirect(url, code=None):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
class Template(object):
|
||||
pass
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
|
||||
from ._helper import expose, popargs, url
|
||||
|
||||
class _ThreadLocalProxy(object):
|
||||
def __getattr__(self, name):
|
||||
pass
|
||||
|
||||
|
||||
request = _ThreadLocalProxy('request')
|
||||
response = _ThreadLocalProxy('response')
|
||||
|
||||
def quickstart(root=None, script_name='', config=None):
|
||||
"""Mount the given root, start the builtin server (and engine), then block."""
|
||||
pass
|
||||
@@ -1,31 +0,0 @@
|
||||
def expose(func=None, alias=None):
|
||||
"""Expose the function or class.
|
||||
Optionally provide an alias or set of aliases.
|
||||
"""
|
||||
def expose_(func):
|
||||
func.exposed = True
|
||||
return func
|
||||
|
||||
return expose_
|
||||
|
||||
|
||||
def popargs(*args, **kwargs):
|
||||
"""Decorate _cp_dispatch."""
|
||||
|
||||
def decorated(cls_or_self=None, vpath=None):
|
||||
if inspect.isclass(cls_or_self):
|
||||
# cherrypy.popargs is a class decorator
|
||||
return cls
|
||||
|
||||
# We're in the actual function
|
||||
self = cls_or_self
|
||||
if vpath:
|
||||
return getattr(self, vpath.pop(0), None)
|
||||
else:
|
||||
return self
|
||||
|
||||
return decorated
|
||||
|
||||
def url(path='', qs='', script_name=None, base=None, relative=None):
|
||||
#Do some opaque stuff here...
|
||||
return new_url
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
|
||||
def render(template='', data={}, partials_path='.', partials_ext='mustache',
|
||||
partials_dict={}, padding='', def_ldel='{{', def_rdel='}}',
|
||||
scopes=None):
|
||||
pass
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
def generate_private_key(key_size, backend):
|
||||
pass
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
|
||||
def generate_private_key(curve, backend):
|
||||
pass
|
||||
|
||||
class SECT571R1(object):
|
||||
name = "sect571r1"
|
||||
key_size = 570
|
||||
|
||||
|
||||
class SECP384R1(object):
|
||||
name = "secp384r1"
|
||||
key_size = 384
|
||||
|
||||
|
||||
class SECP224R1(object):
|
||||
name = "secp224r1"
|
||||
key_size = 224
|
||||
|
||||
|
||||
class SECT163K1(object):
|
||||
name = "sect163k1"
|
||||
key_size = 163
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
def generate_private_key(public_exponent, key_size, backend):
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
class Cipher(object):
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
class ARC4(object):
|
||||
name = "RC4"
|
||||
@@ -1,2 +0,0 @@
|
||||
def loads(*args, **kwargs):
|
||||
return None
|
||||
@@ -1,7 +0,0 @@
|
||||
# https://docs.djangoproject.com/en/1.11/_modules/django/conf/urls/#url
|
||||
def url(regex, view, kwargs=None, name=None):
|
||||
pass
|
||||
|
||||
|
||||
def patterns(*urls):
|
||||
pass
|
||||
@@ -1 +0,0 @@
|
||||
connection = object()
|
||||
@@ -1,2 +0,0 @@
|
||||
class Model:
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
class RawSQL:
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
from .response import *
|
||||
from .request import HttpRequest
|
||||
@@ -1,2 +0,0 @@
|
||||
class HttpRequest(object):
|
||||
pass
|
||||
@@ -1,46 +0,0 @@
|
||||
class HttpResponseBase(object):
|
||||
status_code = 200
|
||||
|
||||
def __init__(self, content_type=None, status=None, reason=None, charset=None):
|
||||
pass
|
||||
|
||||
|
||||
class HttpResponse(HttpResponseBase):
|
||||
def __init__(self, content=b"", *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Content is a bytestring. See the `content` property methods.
|
||||
self.content = content
|
||||
|
||||
|
||||
class HttpResponseRedirectBase(HttpResponse):
|
||||
def __init__(self, redirect_to, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
...
|
||||
|
||||
|
||||
class HttpResponsePermanentRedirect(HttpResponseRedirectBase):
|
||||
status_code = 301
|
||||
|
||||
|
||||
class HttpResponseRedirect(HttpResponseRedirectBase):
|
||||
status_code = 302
|
||||
|
||||
|
||||
class HttpResponseNotFound(HttpResponse):
|
||||
status_code = 404
|
||||
|
||||
|
||||
class JsonResponse(HttpResponse):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
data,
|
||||
encoder=...,
|
||||
safe=True,
|
||||
json_dumps_params=None,
|
||||
**kwargs
|
||||
):
|
||||
# fake code to represent what is going on :)
|
||||
kwargs.setdefault("content_type", "application/json")
|
||||
data = str(data)
|
||||
super().__init__(content=data, **kwargs)
|
||||
@@ -1,8 +0,0 @@
|
||||
# see https://docs.djangoproject.com/en/1.11/_modules/django/shortcuts/#redirect
|
||||
# https://github.com/django/django/blob/86908785076b2bbc31b908781da6b6ad1779b18b/django/shortcuts.py
|
||||
|
||||
def render(request, template_name, context=None, content_type=None, status=None, using=None):
|
||||
pass
|
||||
|
||||
def redirect(to, *args, **kwargs):
|
||||
pass
|
||||
@@ -1,7 +0,0 @@
|
||||
from functools import partial
|
||||
|
||||
def _path(route, view, kwargs=None, name=None, Pattern=None):
|
||||
pass
|
||||
|
||||
path = partial(_path, Pattern='RoutePattern (but this is a mock)')
|
||||
re_path = partial(_path, Pattern='RegexPattern (but this is a mock)')
|
||||
@@ -1,3 +0,0 @@
|
||||
# For django 2.x and 3.x
|
||||
class View:
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
# For django 1.x
|
||||
class View:
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
from .connection import Connection
|
||||
from .group import Group, SerialGroup, ThreadingGroup
|
||||
from .tasks import task
|
||||
@@ -1,29 +0,0 @@
|
||||
# For the 1.x version
|
||||
|
||||
def needs_host(func):
|
||||
@wraps(func)
|
||||
def inner(*args, **kwargs):
|
||||
return func(*args, **kwargs)
|
||||
return inner
|
||||
|
||||
|
||||
def local(command, capture=False, shell=None):
|
||||
pass
|
||||
|
||||
|
||||
@needs_host
|
||||
def run(command, shell=True, pty=True, combine_stderr=None, quiet=False,
|
||||
warn_only=False, stdout=None, stderr=None, timeout=None, shell_escape=None,
|
||||
capture_buffer_size=None):
|
||||
pass
|
||||
|
||||
|
||||
@needs_host
|
||||
def sudo(command, shell=True, pty=True, combine_stderr=None, user=None,
|
||||
quiet=False, warn_only=False, stdout=None, stderr=None, group=None,
|
||||
timeout=None, shell_escape=None, capture_buffer_size=None):
|
||||
pass
|
||||
|
||||
# https://github.com/fabric/fabric/blob/1.14/fabric/tasks.py#L281
|
||||
def execute(task, *args, **kwargs):
|
||||
pass
|
||||
@@ -1,15 +0,0 @@
|
||||
from invoke import Context
|
||||
|
||||
@decorator
|
||||
def opens(method, self, *args, **kwargs):
|
||||
self.open()
|
||||
return method(self, *args, **kwargs)
|
||||
|
||||
class Connection(Context):
|
||||
|
||||
def open(self):
|
||||
pass
|
||||
|
||||
@opens
|
||||
def run(self, command, **kwargs):
|
||||
pass
|
||||
@@ -1,11 +0,0 @@
|
||||
class Group(list):
|
||||
def run(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
class SerialGroup(Group):
|
||||
def run(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
class ThreadingGroup(Group):
|
||||
def run(self, *args, **kwargs):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def task(*args, **kwargs):
|
||||
pass
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
from falcon.api import API
|
||||
from falcon.request import Request
|
||||
from falcon.response import Response
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
"""Falcon API class."""
|
||||
|
||||
class API(object):
|
||||
|
||||
def add_route(self, uri_template, resource, **kwargs):
|
||||
pass
|
||||
|
||||
def add_sink(self, sink, prefix=r'/'):
|
||||
pass
|
||||
|
||||
def add_error_handler(self, exception, handler=None):
|
||||
pass
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
class Request(object):
|
||||
pass
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
|
||||
class Response(object):
|
||||
pass
|
||||
@@ -1,33 +0,0 @@
|
||||
from .globals import request
|
||||
from .globals import current_app
|
||||
|
||||
class Flask(object):
|
||||
# Only some methods mocked, signature copied from
|
||||
# https://flask.palletsprojects.com/en/1.1.x/api/#flask.Flask
|
||||
def run(host=None, port=None, debug=None, load_dotenv=True, **options):
|
||||
pass
|
||||
|
||||
def make_response(rv):
|
||||
pass
|
||||
|
||||
def add_url_rule(rule, endpoint=None, view_func=None, provide_automatic_options=None, **options):
|
||||
pass
|
||||
|
||||
class Response(object):
|
||||
pass
|
||||
|
||||
def redirect(location, code=302, Response=None):
|
||||
pass
|
||||
|
||||
def make_response(rv):
|
||||
if not args:
|
||||
return current_app.response_class()
|
||||
if len(args) == 1:
|
||||
args = args[0]
|
||||
return current_app.make_response(args)
|
||||
|
||||
def escape(txt):
|
||||
return Markup.escape(txt)
|
||||
|
||||
def render_template_string(source, **context):
|
||||
pass
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
class LocalProxy(object):
|
||||
pass
|
||||
|
||||
request = LocalProxy()
|
||||
current_app = LocalProxy()
|
||||
@@ -1,6 +0,0 @@
|
||||
class View(object):
|
||||
pass
|
||||
|
||||
|
||||
class MethodView(object):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
from .context import Context
|
||||
from .tasks import task
|
||||
|
||||
def run(command, **kwargs):
|
||||
pass
|
||||
|
||||
def sudo(command, **kwargs):
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
class Context(object):
|
||||
def run(self, command, **kwargs):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def task(*args, **kwargs):
|
||||
pass
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
class Environment(object):
|
||||
|
||||
def __init__(self, loader, autoescape):
|
||||
pass
|
||||
|
||||
class Template(object):
|
||||
|
||||
def __init__(self, source, autoescape):
|
||||
pass
|
||||
|
||||
def select_autoescape(files=[]):
|
||||
def autoescape(template_name):
|
||||
pass
|
||||
return autoescape
|
||||
|
||||
class FileSystemLoader(object):
|
||||
|
||||
def __init__(self, searchpath):
|
||||
pass
|
||||
|
||||
def from_string(source, globals=None, template_class=None):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
def parseFile(filename):
|
||||
return xmlDoc(_obj=None)
|
||||
|
||||
|
||||
class xmlDoc(Object):
|
||||
def __init__(self, _obj=None):
|
||||
pass
|
||||
|
||||
def xpathEval(self, expr):
|
||||
pass
|
||||
@@ -1,37 +0,0 @@
|
||||
class _ElementTree(object):
|
||||
def xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables):
|
||||
pass
|
||||
|
||||
def xslt(self, _xslt, extensions=None, access_control=None, **_kw):
|
||||
pass
|
||||
|
||||
|
||||
class ETXPath(object):
|
||||
def __init__(self, path, extensions=None, regexp=True, smart_strings=True):
|
||||
pass
|
||||
|
||||
|
||||
class XPath(object):
|
||||
def __init__(self, path, namespaces=None, extensions=None, regexp=True, smart_strings=True):
|
||||
pass
|
||||
|
||||
|
||||
class XSLT(object):
|
||||
def __init__(self, xslt_input, extensions=None, regexp=True, access_control=None):
|
||||
pass
|
||||
|
||||
|
||||
def parse(self, parser=None, base_url=None):
|
||||
return _ElementTree()
|
||||
|
||||
|
||||
def fromstring(self, text, parser=None, base_url=None):
|
||||
pass
|
||||
|
||||
|
||||
def fromstringlist(self, strings, parser=None):
|
||||
pass
|
||||
|
||||
|
||||
def XML(self, text, parser=None, base_url=None):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def loads(*args, **kwargs):
|
||||
return None
|
||||
@@ -1,17 +0,0 @@
|
||||
def system(cmd, *args, **kwargs):
|
||||
return None
|
||||
|
||||
def popen(cmd, *args, **kwargs):
|
||||
return None
|
||||
|
||||
def chmod(path, mode):
|
||||
pass
|
||||
|
||||
def open(path, flags, mode):
|
||||
pass
|
||||
|
||||
def tempnam(*args):
|
||||
pass
|
||||
|
||||
def tmpnam(*args):
|
||||
pass
|
||||
@@ -1,5 +0,0 @@
|
||||
def join(a, *b):
|
||||
return a + "/" + "/".join(b)
|
||||
|
||||
def normpath(x):
|
||||
return x
|
||||
@@ -1,15 +0,0 @@
|
||||
class SSHClient(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def set_missing_host_key_policy(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
class AutoAddPolicy(object):
|
||||
pass
|
||||
|
||||
class WarningPolicy(object):
|
||||
pass
|
||||
|
||||
class RejectPolicy(object):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def loads(*args, **kwargs):
|
||||
return None
|
||||
@@ -1,10 +0,0 @@
|
||||
SSLv2_METHOD = 1
|
||||
SSLv3_METHOD = 2
|
||||
SSLv23_METHOD = 3
|
||||
TLSv1_METHOD = 4
|
||||
TLSv1_1_METHOD = 5
|
||||
TLSv1_2_METHOD = 6
|
||||
|
||||
class Context(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
class Response(object):
|
||||
pass
|
||||
@@ -1,7 +0,0 @@
|
||||
# https://docs.pylonsproject.org/projects/pyramid/en/1.10-branch/_modules/pyramid/view.html#view_config
|
||||
class view_config(object):
|
||||
def __init__(self, **settings):
|
||||
pass
|
||||
|
||||
def __call__(self, wrapped):
|
||||
pass
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
def get(url, params=None, **kwargs):
|
||||
pass
|
||||
|
||||
def options(url, **kwargs):
|
||||
pass
|
||||
|
||||
def head(url, **kwargs):
|
||||
pass
|
||||
|
||||
def post(url, data=None, json=None, **kwargs):
|
||||
pass
|
||||
|
||||
def put(url, data=None, **kwargs):
|
||||
pass
|
||||
|
||||
def patch(url, data=None, **kwargs):
|
||||
pass
|
||||
|
||||
def delete(url, **kwargs):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def Popen(*args, **kwargs):
|
||||
return None
|
||||
@@ -1,30 +0,0 @@
|
||||
|
||||
def validate(validators):
|
||||
def validator(func):
|
||||
return func
|
||||
|
||||
def expose(*args):
|
||||
if cond:
|
||||
return args[0]
|
||||
def with_template(func):
|
||||
func
|
||||
return with_template
|
||||
|
||||
class TGController(object):
|
||||
pass
|
||||
|
||||
class TurboGearsContextMember(object):
|
||||
"""Member of the TurboGears request context.
|
||||
Provides access to turbogears context members
|
||||
like request, response, template context and so on
|
||||
"""
|
||||
|
||||
def __init__(self, name):
|
||||
self.__dict__['name'] = name
|
||||
|
||||
def _current_obj(self):
|
||||
return getattr(context, self.name)
|
||||
|
||||
|
||||
request = TurboGearsContextMember(name="request")
|
||||
response = TurboGearsContextMember(name="response")
|
||||
@@ -1,2 +0,0 @@
|
||||
class RequestHandler(object):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def format_exc():
|
||||
return None
|
||||
@@ -1,2 +0,0 @@
|
||||
class Request(object):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
class Resource(object):
|
||||
pass
|
||||
@@ -1,2 +0,0 @@
|
||||
def load(s):
|
||||
pass
|
||||
@@ -1,9 +0,0 @@
|
||||
class Interface():
|
||||
pass
|
||||
|
||||
|
||||
class implementer:
|
||||
|
||||
def __call__(self, ob):
|
||||
...
|
||||
return ob
|
||||
Reference in New Issue
Block a user