Skip to content

Commit

Permalink
Update test build pipeline to 3.11
Browse files Browse the repository at this point in the history
Update dependencies (faker,crytpography,pyperf,msal)
fix test cases
  • Loading branch information
cedric05 authored Mar 16, 2024
1 parent f805fac commit 04e921b
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Python 3
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- name: Install dependencies
run: |
sudo apt-get install tar
Expand Down
5 changes: 2 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ jsonschema = "==4.21.1"
jstyleson = "==0.0.2"
requests = "==2.31.0"
textx = "==4.0.1"
js2py = "==0.74"
requests-pkcs12 = "==1.24"
parsys-requests-unixsocket = "==0.3.1"
requests-aws4auth = "==1.2.3"
requests-ntlm = "==1.2.0"
restrictedpython = "==7.0"
faker = "==23.1.0"
faker = "==24.1.0"
requests-hawk = "==1.2.1"
pyyaml = "==6.0.1"
toml = "==0.10.2"
msal = "==1.26.0"
msal = "==1.27.0"

[dev-packages]
python-magic = "*"
Expand Down
304 changes: 152 additions & 152 deletions Pipfile.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion all_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-r requirements.txt
-r test_requirements.txt
-r ./benchmarks/requirements.txt
python-magic
python-magic
js2py==0.74
2 changes: 1 addition & 1 deletion dothttp/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.43a10"
__version__ = "0.0.43a11"
10 changes: 7 additions & 3 deletions dothttp/script/js3py.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
from operator import getitem

import cryptography
import js2py
import yaml
from cryptography import *
from faker import Faker
from js2py.base import JsObjectWrapper
from js2py.internals.simplex import JsException
from requests import Response
from RestrictedPython import compile_restricted, safe_globals
from RestrictedPython.Eval import default_guarded_getiter
Expand All @@ -32,6 +29,13 @@
from ..utils.common import get_real_file_path
from ..utils.property_util import PropertyProvider

try:
import js2py
from js2py.base import JsObjectWrapper
from js2py.internals.simplex import JsException
except:
pass


def write_guard(x):
if isinstance(x, Client):
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
jsonschema==4.21.1
jstyleson==0.0.2
textx==4.0.1
js2py==0.74
requests_pkcs12==1.24
parsys-requests-unixsocket==0.3.1
requests-aws4auth==1.2.3
requests_ntlm==1.2.0
RestrictedPython==7.0
Faker==23.1.0
Faker==24.1.0
requests-hawk==1.2.1
msal==1.26.0
msal==1.27.0
PyYaml==6.0.1
toml==0.10.2
requests==2.31.0
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def requirements():
options={"bdist_wheel": {"universal": False}},
packages=find_packages(exclude=EXCLUDE),
install_requires=requirements(),
extras_require={},
extras_require={
"js": ["js2py"]
},
long_description=read("README.md"),
long_description_content_type=("text/markdown"),
classifiers=[
Expand Down
31 changes: 8 additions & 23 deletions test/core/test_script_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ def test_python(self):
"properties": {},
"tests": [
{
"name": "test_hai (test_script.SampleTest)",
# python3.11
# "name": "test_hai (test_script.SampleTest.test_hai)",
"name": "test_hai (test_script.SampleTest.test_hai)",
"success": True,
"result": None,
"error": None,
Expand Down Expand Up @@ -157,9 +155,7 @@ def test_status_code(self):
"stdout": "",
"tests": [
{
"name": "test_status_code (test_script.SampleTestCase)",
# python3.11
# 'name': 'test_status_code (test_script.SampleTestCase.test_status_code)',
'name': 'test_status_code (test_script.SampleTestCase.test_status_code)',
"success": True,
"result": None,
"error": None,
Expand Down Expand Up @@ -223,32 +219,25 @@ def test_hash(self):
"tests": [
{
"name": "test_date (test_script.SampleTestCase)",
# python3.11
# 'name': 'test_date (test_script.SampleTestCase.test_date)',
'name': 'test_date (test_script.SampleTestCase.test_date)',
"success": True,
"result": None,
"error": None,
},
{
"name": "test_hash (test_script.SampleTestCase)",
# python3.11
# 'name': 'test_hash (test_script.SampleTestCase.test_hash)',
'name': 'test_hash (test_script.SampleTestCase.test_hash)',
"success": True,
"result": None,
"error": None,
},
{
"name": "test_headers (test_script.SampleTestCase)",
# python3.11
# 'name': 'test_headers (test_script.SampleTestCase.test_headers)',
'name': 'test_headers (test_script.SampleTestCase.test_headers)',
"success": True,
"result": None,
"error": None,
},
{
"name": "test_math (test_script.SampleTestCase)",
# python3.11
# 'name': 'test_math (test_script.SampleTestCase.test_math)',
'name': 'test_math (test_script.SampleTestCase.test_math)',
"success": True,
"result": None,
"error": None,
Expand All @@ -273,9 +262,7 @@ def test_status_code(self):
"properties": {},
"tests": [
{
"name": "test_status_code (test_script.SampleTestCase)",
# python3.11
# 'test_status_code (test_script.SampleTestCase.test_status_code)',
"name": 'test_status_code (test_script.SampleTestCase.test_status_code)',
"success": False,
"result": None,
"error": 'Traceback (most recent call last):\n File "test_script.py", line 4, in test_status_code\nAssertionError: 401 != 200\n',
Expand Down Expand Up @@ -305,9 +292,7 @@ def test_raise(self):
"error": "Traceback (most recent call last):\n"
' File "test_script.py", line 4, in test_raise\n'
"Exception\n",
"name": "test_raise (test_script.SampleTestCase)",
# python3.11
# 'test_raise (test_script.SampleTestCase.test_raise)',
"name": "test_raise (test_script.SampleTestCase.test_raise)",
"result": None,
"success": False,
}
Expand Down

0 comments on commit 04e921b

Please sign in to comment.