diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 185ba92b6..d21537b88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -88,13 +88,28 @@ jobs: - name: Run unit tests run: task test-unit - - name: Build the Agent for linux - run: task build - if: matrix.os == 'ubuntu-18.04' - - # build the agent without GUI support (no tray icon) + # build the agent without GUI support (no tray icon) for e2e testing - name: Build the Agent-cli run: task build-cli + if: matrix.os != 'windows-2019' + + - name: Build the Agent-cli for win + run: task build-win-cli + if: matrix.os == 'windows-2019' + + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + architecture: 'x64' + + - name: Run e2e tests + run: | + pip install poetry + task test-e2e + + - name: Build the Agent for linux + run: task build if: matrix.os == 'ubuntu-18.04' # the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28) @@ -123,19 +138,6 @@ jobs: run: task build if: matrix.os == 'macos-10.15' - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - architecture: 'x64' - if: matrix.os == 'macos-10.15' - - - name: Run e2e tests - run: | - pip install poetry - task test-e2e - if: matrix.os == 'macos-10.15' - # this will create `public/` dir with compressed full bin (/-.gz) and a json file - name: Create autoupdate files run: go-selfupdate arduino-create-agent${{ matrix.ext }} ${TAG_VERSION} @@ -158,6 +160,7 @@ jobs: name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }} path: | arduino-create-agent* + !arduino-create-agent_cli* config.ini if-no-files-found: error @@ -296,10 +299,6 @@ jobs: - name: Rename executable to Arduino_Create_Agent run: mv -v ${{ matrix.executable-path }}arduino-create-agent${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent${{ matrix.extension }} - - name: Rename executable to Arduino_Create_Agent_cli - run: mv -v ${{ matrix.executable-path }}arduino-create-agent_cli${{ matrix.extension }} ${{ matrix.executable-path }}Arduino_Create_Agent_cli${{ matrix.extension }} - if: matrix.os == 'ubuntu-18.04' - - name: get year run: echo "YEAR=$(date "+%Y")" >> $GITHUB_ENV if: matrix.os == 'macos-10.15' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 708f82254..60e4857c5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,13 +56,28 @@ jobs: - name: Run unit tests run: task test-unit - - name: Build the Agent for linux - run: task build - if: matrix.os == 'ubuntu-18.04' - - # build the agent without GUI support (no tray icon) + # build the agent without GUI support (no tray icon) for e2e testing - name: Build the Agent-cli run: task build-cli + if: matrix.os != 'windows-2019' + + - name: Build the Agent-cli for win + run: task build-win-cli + if: matrix.os == 'windows-2019' + + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + architecture: 'x64' + + - name: Run e2e tests + run: | + pip install poetry + task test-e2e + + - name: Build the Agent for linux + run: task build if: matrix.os == 'ubuntu-18.04' # the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28) @@ -91,19 +106,6 @@ jobs: run: task build if: matrix.os == 'macos-10.15' - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - architecture: 'x64' - if: matrix.os == 'macos-10.15' - - - name: Run e2e tests - run: | - pip install poetry - task test-e2e - if: matrix.os == 'macos-10.15' - # config.ini is required by the executable when it's run - name: Upload artifacts uses: actions/upload-artifact@v2 @@ -111,5 +113,6 @@ jobs: name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }} path: | arduino-create-agent* + !arduino-create-agent_cli* config.ini if-no-files-found: error diff --git a/Taskfile.yml b/Taskfile.yml index 48c6fb534..7be648f60 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -28,6 +28,14 @@ tasks: WIN_FLAGS: -H=windowsgui - rm *.syso # rm file to avoid compilation problems on other platforms + build-win-cli: + desc: Build the project without tray support + cmds: + - task: build + vars: + APP_NAME: arduino-create-agent_cli.exe + ADDITIONAL_FLAGS: -tags cli + test-unit: desc: Run unit tests only cmds: diff --git a/poetry.lock b/poetry.lock index 0d51c0ae4..da80d75e1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,8 +1,16 @@ +[[package]] +name = "asyncio" +version = "3.4.3" +description = "reference implementation of PEP 3156" +category = "main" +optional = false +python-versions = "*" + [[package]] name = "atomicwrites" version = "1.4.0" description = "Atomic file writes." -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -10,7 +18,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "attrs" version = "20.3.0" description = "Classes Without Boilerplate" -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -20,27 +28,42 @@ docs = ["furo", "sphinx", "zope.interface"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] +[[package]] +name = "beautifulsoup4" +version = "4.9.3" +description = "Screen-scraping library" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +soupsieve = {version = ">1.2", markers = "python_version >= \"3.0\""} + +[package.extras] +html5lib = ["html5lib"] +lxml = ["lxml"] + [[package]] name = "certifi" version = "2020.12.5" description = "Python package for providing Mozilla's CA Bundle." -category = "dev" +category = "main" optional = false python-versions = "*" [[package]] name = "chardet" -version = "4.0.0" +version = "3.0.4" description = "Universal encoding detector for Python 2 and 3" -category = "dev" +category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = "*" [[package]] name = "colorama" version = "0.4.4" description = "Cross-platform colored terminal text." -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -48,7 +71,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" name = "idna" version = "2.10" description = "Internationalized Domain Names in Applications (IDNA)" -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -56,7 +79,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "iniconfig" version = "1.1.1" description = "iniconfig: brain-dead simple config-ini parsing" -category = "dev" +category = "main" optional = false python-versions = "*" @@ -64,26 +87,34 @@ python-versions = "*" name = "invoke" version = "1.5.0" description = "Pythonic task execution" -category = "dev" +category = "main" optional = false python-versions = "*" [[package]] name = "packaging" -version = "20.8" +version = "20.9" description = "Core utilities for Python packages" -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [package.dependencies] pyparsing = ">=2.0.2" +[[package]] +name = "pathlib" +version = "1.0.1" +description = "Object-oriented filesystem paths" +category = "main" +optional = false +python-versions = "*" + [[package]] name = "pluggy" version = "0.13.1" description = "plugin and hook calling mechanisms for python" -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -105,7 +136,7 @@ test = ["ipaddress", "mock", "unittest2", "enum34", "pywin32", "wmi"] name = "py" version = "1.10.0" description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -113,15 +144,15 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "pyparsing" version = "2.4.7" description = "Python parsing module" -category = "dev" +category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "pytest" -version = "6.2.1" +version = "6.2.2" description = "pytest: simple powerful testing with Python" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -138,11 +169,42 @@ toml = "*" [package.extras] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +[[package]] +name = "python-engineio" +version = "3.14.2" +description = "Engine.IO server" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +six = ">=1.9.0" + +[package.extras] +asyncio_client = ["aiohttp (>=3.4)"] +client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] + +[[package]] +name = "python-socketio" +version = "4.6.1" +description = "Socket.IO server" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +python-engineio = ">=3.13.0,<4" +six = ">=1.9.0" + +[package.extras] +asyncio_client = ["aiohttp (>=3.4)", "websockets (>=7.0)"] +client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] + [[package]] name = "requests" version = "2.25.1" description = "Python HTTP for Humans." -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" @@ -156,19 +218,35 @@ urllib3 = ">=1.21.1,<1.27" security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] +[[package]] +name = "six" +version = "1.15.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "soupsieve" +version = "2.2" +description = "A modern CSS selector implementation for Beautiful Soup." +category = "main" +optional = false +python-versions = ">=3.6" + [[package]] name = "toml" version = "0.10.2" description = "Python Library for Tom's Obvious, Minimal Language" -category = "dev" +category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "urllib3" -version = "1.26.2" +version = "1.26.3" description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "dev" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" @@ -180,9 +258,15 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "d4024a50235f771811ce457845b6cfef87950b8eb07a8a6e3ad10005482c8a05" +content-hash = "25afb8cae24278ff5736e92d5b94fc99f43ced6fdd9af05ef31205fb85b047ba" [metadata.files] +asyncio = [ + {file = "asyncio-3.4.3-cp33-none-win32.whl", hash = "sha256:b62c9157d36187eca799c378e572c969f0da87cd5fc42ca372d92cdb06e7e1de"}, + {file = "asyncio-3.4.3-cp33-none-win_amd64.whl", hash = "sha256:c46a87b48213d7464f22d9a497b9eef8c1928b68320a2fa94240f969f6fec08c"}, + {file = "asyncio-3.4.3-py3-none-any.whl", hash = "sha256:c4d18b22701821de07bd6aea8b53d21449ec0ec5680645e5317062ea21817d2d"}, + {file = "asyncio-3.4.3.tar.gz", hash = "sha256:83360ff8bc97980e4ff25c964c7bd3923d333d177aa4f7fb736b019f26c7cb41"}, +] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, @@ -191,13 +275,18 @@ attrs = [ {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, ] +beautifulsoup4 = [ + {file = "beautifulsoup4-4.9.3-py2-none-any.whl", hash = "sha256:4c98143716ef1cb40bf7f39a8e3eec8f8b009509e74904ba3a7b315431577e35"}, + {file = "beautifulsoup4-4.9.3-py3-none-any.whl", hash = "sha256:fff47e031e34ec82bf17e00da8f592fe7de69aeea38be00523c04623c04fb666"}, + {file = "beautifulsoup4-4.9.3.tar.gz", hash = "sha256:84729e322ad1d5b4d25f805bfa05b902dd96450f43842c4e99067d5e1369eb25"}, +] certifi = [ {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, ] chardet = [ - {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"}, - {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"}, + {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, + {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, ] colorama = [ {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, @@ -217,8 +306,11 @@ invoke = [ {file = "invoke-1.5.0.tar.gz", hash = "sha256:f0c560075b5fb29ba14dad44a7185514e94970d1b9d57dcd3723bec5fed92650"}, ] packaging = [ - {file = "packaging-20.8-py2.py3-none-any.whl", hash = "sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858"}, - {file = "packaging-20.8.tar.gz", hash = "sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093"}, + {file = "packaging-20.9-py2.py3-none-any.whl", hash = "sha256:67714da7f7bc052e064859c05c595155bd1ee9f69f76557e21f051443c20947a"}, + {file = "packaging-20.9.tar.gz", hash = "sha256:5b327ac1320dc863dca72f4514ecc086f31186744b84a230374cc1fd776feae5"}, +] +pathlib = [ + {file = "pathlib-1.0.1.tar.gz", hash = "sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f"}, ] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, @@ -263,18 +355,34 @@ pyparsing = [ {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, ] pytest = [ - {file = "pytest-6.2.1-py3-none-any.whl", hash = "sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8"}, - {file = "pytest-6.2.1.tar.gz", hash = "sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306"}, + {file = "pytest-6.2.2-py3-none-any.whl", hash = "sha256:b574b57423e818210672e07ca1fa90aaf194a4f63f3ab909a2c67ebb22913839"}, + {file = "pytest-6.2.2.tar.gz", hash = "sha256:9d1edf9e7d0b84d72ea3dbcdfd22b35fb543a5e8f2a60092dd578936bf63d7f9"}, +] +python-engineio = [ + {file = "python-engineio-3.14.2.tar.gz", hash = "sha256:eab4553f2804c1ce97054c8b22cf0d5a9ab23128075248b97e1a5b2f29553085"}, + {file = "python_engineio-3.14.2-py2.py3-none-any.whl", hash = "sha256:5a9e6086d192463b04a1428ff1f85b6ba631bbb19d453b144ffc04f530542b84"}, +] +python-socketio = [ + {file = "python-socketio-4.6.1.tar.gz", hash = "sha256:cd1f5aa492c1eb2be77838e837a495f117e17f686029ebc03d62c09e33f4fa10"}, + {file = "python_socketio-4.6.1-py2.py3-none-any.whl", hash = "sha256:5a21da53fdbdc6bb6c8071f40e13d100e0b279ad997681c2492478e06f370523"}, ] requests = [ {file = "requests-2.25.1-py2.py3-none-any.whl", hash = "sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e"}, {file = "requests-2.25.1.tar.gz", hash = "sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"}, ] +six = [ + {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, + {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, +] +soupsieve = [ + {file = "soupsieve-2.2-py3-none-any.whl", hash = "sha256:d3a5ea5b350423f47d07639f74475afedad48cf41c0ad7a82ca13a3928af34f6"}, + {file = "soupsieve-2.2.tar.gz", hash = "sha256:407fa1e8eb3458d1b5614df51d9651a1180ea5fedf07feb46e45d7e25e6d6cdd"}, +] toml = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] urllib3 = [ - {file = "urllib3-1.26.2-py2.py3-none-any.whl", hash = "sha256:d8ff90d979214d7b4f8ce956e80f4028fc6860e4431f731ea4a8c08f23f99473"}, - {file = "urllib3-1.26.2.tar.gz", hash = "sha256:19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08"}, + {file = "urllib3-1.26.3-py2.py3-none-any.whl", hash = "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80"}, + {file = "urllib3-1.26.3.tar.gz", hash = "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73"}, ] diff --git a/pyproject.toml b/pyproject.toml index c3d576b7c..74d4b46d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,11 +8,15 @@ license = "GPLv2" [tool.poetry.dependencies] python = "^3.9" psutil = "^5.8.0" - -[tool.poetry.dev-dependencies] -pytest = "^6.2.1" +pytest = "^6.2.2" requests = "^2.25.1" invoke = "^1.5.0" +pathlib = "^1.0.1" +asyncio = "^3.4.3" +python-socketio = "^4" +beautifulsoup4 = "^4.9.3" + +[tool.poetry.dev-dependencies] [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/test/conftest.py b/test/conftest.py index fd50856ec..d39b2a679 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -7,12 +7,13 @@ import pytest from invoke import Local from invoke.context import Context - +import socketio as io +import asyncio @pytest.fixture(scope="function") def agent(pytestconfig): - agent_cli = str(Path(pytestconfig.rootdir) / "arduino-create-agent") + agent_cli = str(Path(pytestconfig.rootdir) / "arduino-create-agent_cli") env = { # "ARDUINO_DATA_DIR": data_dir, # "ARDUINO_DOWNLOADS_DIR": downloads_dir, @@ -23,6 +24,9 @@ def agent(pytestconfig): runner = Local(run_context) # execute a command on the local filesystem cd_command = "cd" + if platform.system() == "Windows": + cd_command += " /d" + with run_context.prefix(f'{cd_command} ..'): runner.run(agent_cli, echo=True, hide=True, warn=True, env=env, asynchronous=True) @@ -43,3 +47,10 @@ def agent(pytestconfig): @pytest.fixture(scope="session") def base_url(): return "http://127.0.0.1:8991" + +@pytest.fixture(scope="session") +def socketio(base_url, data=""): + sio = io.Client() + sio.connect(base_url) + yield sio + sio.disconnect() diff --git a/test/test_debug_console.py b/test/test_debug_console.py new file mode 100644 index 000000000..f21062677 --- /dev/null +++ b/test/test_debug_console.py @@ -0,0 +1,9 @@ +import requests +from bs4 import BeautifulSoup + +def test_valid_html(base_url, agent): + resp = requests.get(f"{base_url}") + assert resp.status_code == 200 + print(resp.text) + assert bool(BeautifulSoup(resp.text, "html.parser").find()) + diff --git a/test/test_info.py b/test/test_info.py index 7e79b7a07..aff6d7979 100644 --- a/test/test_info.py +++ b/test/test_info.py @@ -2,10 +2,16 @@ import requests -def test_version(base_url, agent): +def test_info(base_url, agent): resp = requests.get(f"{base_url}/info") assert resp.status_code == 200 - info = resp.json() assert re.match("[0-9]+.[0-9]+.[0-9]+", info["version"]) is not None + assert info["http"] is not None + assert info["https"] is not None + assert info["origins"] is not None + assert info["os"] is not None + assert info["update_url"] is not None + assert info["ws"] is not None + assert info["wss"] is not None diff --git a/test/test_ws.py b/test/test_ws.py new file mode 100644 index 000000000..90f18504d --- /dev/null +++ b/test/test_ws.py @@ -0,0 +1,11 @@ +import asyncio +import socketio as io +import time + +def test_ws_connection(agent, socketio): + print('my sid is', socketio.sid) + assert socketio.sid is not None + +def test_list(agent, socketio): + socketio.emit('command', 'list') +