From e1b2ae44b8b4864f6495dfa894f671e1eb6f9f19 Mon Sep 17 00:00:00 2001 From: Rasmus Wriedt Larsen Date: Fri, 16 Aug 2024 11:51:07 +0200 Subject: [PATCH] Python: Additional threatModelSource annotations --- .../ql/test/library-tests/frameworks/django-v2-v3/manage.py | 4 ++-- .../library-tests/frameworks/django-v2-v3/testproj/asgi.py | 2 +- .../library-tests/frameworks/django-v2-v3/testproj/wsgi.py | 2 +- .../ql/test/library-tests/frameworks/rest_framework/manage.py | 4 ++-- .../library-tests/frameworks/stdlib-py3/FileSystemAccess.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/ql/test/library-tests/frameworks/django-v2-v3/manage.py b/python/ql/test/library-tests/frameworks/django-v2-v3/manage.py index 0e1a0b64a6e63..9fa5846c95518 100755 --- a/python/ql/test/library-tests/frameworks/django-v2-v3/manage.py +++ b/python/ql/test/library-tests/frameworks/django-v2-v3/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') # $ threatModelSource[environment]=os.environ try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -15,7 +15,7 @@ def main(): "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc - execute_from_command_line(sys.argv) + execute_from_command_line(sys.argv) # $ threatModelSource[commandargs]=sys.argv if __name__ == '__main__': diff --git a/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/asgi.py b/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/asgi.py index 33b113ce911d6..4906268e41616 100644 --- a/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/asgi.py +++ b/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/asgi.py @@ -11,6 +11,6 @@ from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') # $ threatModelSource[environment]=os.environ application = get_asgi_application() diff --git a/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/wsgi.py b/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/wsgi.py index b466637895b7b..a3f803658abca 100644 --- a/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/wsgi.py +++ b/python/ql/test/library-tests/frameworks/django-v2-v3/testproj/wsgi.py @@ -11,6 +11,6 @@ from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') # $ threatModelSource[environment]=os.environ application = get_wsgi_application() diff --git a/python/ql/test/library-tests/frameworks/rest_framework/manage.py b/python/ql/test/library-tests/frameworks/rest_framework/manage.py index 0e1a0b64a6e63..9fa5846c95518 100755 --- a/python/ql/test/library-tests/frameworks/rest_framework/manage.py +++ b/python/ql/test/library-tests/frameworks/rest_framework/manage.py @@ -6,7 +6,7 @@ def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings') # $ threatModelSource[environment]=os.environ try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -15,7 +15,7 @@ def main(): "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?" ) from exc - execute_from_command_line(sys.argv) + execute_from_command_line(sys.argv) # $ threatModelSource[commandargs]=sys.argv if __name__ == '__main__': diff --git a/python/ql/test/library-tests/frameworks/stdlib-py3/FileSystemAccess.py b/python/ql/test/library-tests/frameworks/stdlib-py3/FileSystemAccess.py index 4de7f3a3c329d..45eff39d82cb9 100644 --- a/python/ql/test/library-tests/frameworks/stdlib-py3/FileSystemAccess.py +++ b/python/ql/test/library-tests/frameworks/stdlib-py3/FileSystemAccess.py @@ -17,7 +17,7 @@ name = windows.parent.name o = open -o(name) # $ getAPathArgument=name +o(name) # $ getAPathArgument=name threatModelSource[file]=o(..) wb = p.write_bytes wb(b"hello") # $ getAPathArgument=p fileWriteData=b"hello"