diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f79b19..d93bae2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,10 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.github_token }} steps: - uses: actions/checkout@v4.1.1 - - uses: cachix/install-nix-action@v22 + - uses: cachix/install-nix-action@v25 with: nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/cachix-action@v12 + - uses: cachix/cachix-action@v14 with: name: datakurre - run: make nix-show nix-test nix-coverage nix-coveralls nix-docs PYTHON=${{ matrix.python }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..94591f6 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,35 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + # You can also specify other tool versions: + # nodejs: "20" + # rust: "1.70" + # golang: "1.20" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs + # builder: "dirhtml" + # Fail on all warnings to avoid broken references + # fail_on_warning: true + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/_static/sphinxcontrib-httpexample.css b/docs/_static/sphinxcontrib-httpexample.css index ef27be9..6926cfb 100644 --- a/docs/_static/sphinxcontrib-httpexample.css +++ b/docs/_static/sphinxcontrib-httpexample.css @@ -17,6 +17,7 @@ .http-example div[class^='highlight'] pre { white-space: normal; } +.http-example-JavaScript div[class^='highlight'] pre, .http-example-http div[class^='highlight'] pre, .http-example-response div[class^='highlight'] pre { white-space: pre; diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..6acf95b --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,62 @@ +Jinja2==3.0.3 +MarkupSafe==2.0.1 +alabaster==0.7.12 +astunparse==1.6.3 +attrs==21.2.0 +babel==2.9.1 +certifi==2022.12.7 +charset-normalizer==2.0.9 +coverage==6.2 +coveralls==3.3.1 +docopt==0.6.2 +docutils==0.16 +flake8==4.0.1 +flake8-blind-except==0.2.0 +flake8-coding==1.3.2 +flake8-debugger==4.0.0 +flake8-isort==4.1.1 +flake8-polyfill==1.0.2 +flake8-quotes==3.3.1 +idna==3.3 +imagesize==1.3.0 +importlib-metadata==4.10.0 +iniconfig==1.1.1 +isort==5.10.1 +mccabe==0.6.1 +packaging==21.3 +pep8-naming==0.12.1 +pillow==8.4.0 +pluggy==1.0.0 +poetry-core==1.0.7 +py==1.11.0 +pycodestyle==2.8.0 +pyflakes==2.4.0 +pygments==2.10.0 +pyparsing==3.0.6 +pytest==6.2.5 +pytest-cov==2.12.1 +pytest-runner==5.3.1 +pytz==2021.3 +pyyaml==6.0 +reportlab==3.6.3 +requests==2.26.0 +rst2pdf==0.98 +six==1.16.0 +smartypants==2.0.1 +snapshottest==0.5.0 +snowballstemmer==2.2.0 +sphinx==4.3.2 +sphinx-rtd-theme==1.0.0 +sphinx-testing==1.0.1 +sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==2.0.0 +sphinxcontrib-httpdomain==1.8.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.5 +termcolor==1.1.0 +testfixtures==6.18.3 +toml==0.10.2 +urllib3==1.26.7 +zipp==3.6.0 diff --git a/docs/usage.rst b/docs/usage.rst index 2740394..d355cd6 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -13,7 +13,7 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript GET /Plone/front-page HTTP/1.1 Host: localhost:8080 @@ -70,7 +70,7 @@ Code Result `````` -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript GET /Plone/front-page HTTP/1.1 Host: localhost:8080 @@ -121,7 +121,7 @@ Result or with inline response starting with just "HTTP " without the HTTP version: -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript GET /Plone/front-page HTTP/1.1 Host: localhost:8080 @@ -179,7 +179,7 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript POST /Plone/folder HTTP/1.1 Host: localhost:8080 @@ -195,7 +195,7 @@ Code Result `````` -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript POST /Plone/folder HTTP/1.1 Host: localhost:8080 @@ -216,7 +216,7 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript PATCH /Plone/folder/my-document HTTP/1.1 Host: localhost:8080 @@ -231,7 +231,7 @@ Code Result `````` -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript PATCH /Plone/folder/my-document HTTP/1.1 Host: localhost:8080 @@ -252,7 +252,7 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript GET /items?user_id=12&user_id=13 HTTP/1.1 Host: localhost @@ -269,7 +269,7 @@ Code Result `````` - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript GET /items?user_id=12&user_id=13 HTTP/1.1 Host: localhost @@ -294,14 +294,14 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript :request: ../tests/fixtures/001.request.txt :response: ../tests/fixtures/001.response.txt Result `````` -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript :request: ../tests/fixtures/001.request.txt :response: ../tests/fixtures/001.response.txt @@ -313,14 +313,14 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript :request: ../tests/fixtures/002.request.txt :response: ../tests/fixtures/002.response.txt Result `````` -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript :request: ../tests/fixtures/002.request.txt :response: ../tests/fixtures/002.response.txt @@ -332,13 +332,13 @@ Code .. code-block:: rst - .. http:example:: curl wget httpie python-requests + .. http:example:: curl wget httpie python-requests plone-javascript :request: ../tests/fixtures/003.request.txt :response: ../tests/fixtures/003.response.txt Result `````` -.. http:example:: curl wget httpie python-requests +.. http:example:: curl wget httpie python-requests plone-javascript :request: ../tests/fixtures/003.request.txt :response: ../tests/fixtures/003.response.txt diff --git a/src/sphinxcontrib/httpexample/builders.py b/src/sphinxcontrib/httpexample/builders.py index 51e56d2..dd74a34 100644 --- a/src/sphinxcontrib/httpexample/builders.py +++ b/src/sphinxcontrib/httpexample/builders.py @@ -212,6 +212,31 @@ def build_httpie_command(request): return 'echo {} | {}'.format(redir_input, cmd) +def build_plone_javascript_command(request): + javascript_code = 'createAliasesMutation' + redir_input2 = '' + + # Request body + data = maybe_str(request.data()) + if data: + if is_json(request.headers.get('Content-Type', '')): + redir_input2 = json.dumps( + data, indent=2, sort_keys=True, + separators=(',', ': '), + ).encode('utf-8') + else: + redir_input2 = data + + # Output string + output_string =\ + "{}\n|\nconst aliasesData = '{}';".format( + maybe_str(javascript_code), + maybe_str(redir_input2), + ) + + return output_string + + def flatten_parsed_qs(data): """Flatten single value lists in parse_qs results.""" for key, value in data.items(): diff --git a/src/sphinxcontrib/httpexample/directives.py b/src/sphinxcontrib/httpexample/directives.py index e7fd8e6..bbe55c3 100644 --- a/src/sphinxcontrib/httpexample/directives.py +++ b/src/sphinxcontrib/httpexample/directives.py @@ -16,7 +16,9 @@ 'wget': (builders.build_wget_command, 'bash'), 'httpie': (builders.build_httpie_command, 'bash'), 'requests': (builders.build_requests_command, 'python'), - 'python-requests': (builders.build_requests_command, 'python') + 'python-requests': (builders.build_requests_command, 'python'), + 'plone-javascript': (builders.build_plone_javascript_command, + 'javascript'), } AVAILABLE_FIELDS = [ @@ -127,6 +129,10 @@ def run(self): for name in chosen_builders: request = parsers.parse_request(raw, config.httpexample_scheme) builder_, language = AVAILABLE_BUILDERS[name] + + # Setting plone JavaScript tab name + name = 'JavaScript' if name == 'plone-javascript' else name + command = builder_(request) content = StringList( diff --git a/src/sphinxcontrib/httpexample/static/sphinxcontrib-httpexample.css b/src/sphinxcontrib/httpexample/static/sphinxcontrib-httpexample.css index 86e7d49..5213d05 100644 --- a/src/sphinxcontrib/httpexample/static/sphinxcontrib-httpexample.css +++ b/src/sphinxcontrib/httpexample/static/sphinxcontrib-httpexample.css @@ -20,6 +20,7 @@ .http-example div.highlight-bash pre { white-space: pre-wrap; } +.http-example-JavaScript div[class^='highlight'] pre, .http-example-http div[class^='highlight'] pre, .http-example-response div[class^='highlight'] pre { white-space: pre; diff --git a/tests/snapshots/snap_test_builders.py b/tests/snapshots/snap_test_builders.py index 4b2ad4b..49dad4f 100644 --- a/tests/snapshots/snap_test_builders.py +++ b/tests/snapshots/snap_test_builders.py @@ -7,25 +7,6 @@ snapshots = Snapshot() -snapshots['test_fixture[build_httpie_command-fixture_001] 1'] = 'http http://localhost:8080/Plone/front-page Accept:application/json -a admin:admin' - -snapshots['test_fixture[build_httpie_command-fixture_002] 1'] = '''echo '{ - "@type": "Document", - "title": "My Document" -}' | http POST http://localhost:8080/Plone/folder Accept:application/json Content-Type:application/json -a admin:admin''' - -snapshots['test_fixture[build_httpie_command-fixture_003] 1'] = '''echo '{ - "title": "My New Document Title" -}' | http PATCH http://localhost:8080/Plone/folder/my-document Accept:application/json Content-Type:application/json -a admin:admin''' - -snapshots['test_fixture[build_httpie_command-fixture_004] 1'] = 'http http://localhost:8080/Plone/front-page Accept:application/json' - -snapshots['test_fixture[build_httpie_command-fixture_005] 1'] = 'http http://localhost:8080/Plone/front-page Accept:application/json Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI"' - -snapshots['test_fixture[build_httpie_command-fixture_006] 1'] = 'echo defgh | http PATCH http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f Accept:application/json Content-Type:"application/offset+octet-stream" Tus-Resumable:1.0.0 Upload-Offset:3 -a admin:secret' - -snapshots['test_fixture[build_httpie_command-fixture_007] 1'] = "http 'http://localhost:8080/Plone/front-page?foo=bar&bar=foo' Accept:application/json -a admin:admin" - snapshots['test_fixture[build_curl_command-fixture_001] 1'] = 'curl -i -X GET http://localhost:8080/Plone/front-page -H "Accept: application/json" --user admin:admin' snapshots['test_fixture[build_curl_command-fixture_002] 1'] = 'curl -i -X POST http://localhost:8080/Plone/folder -H "Accept: application/json" -H "Content-Type: application/json" --data-raw \'{"@type": "Document", "title": "My Document"}\' --user admin:admin' @@ -40,42 +21,39 @@ snapshots['test_fixture[build_curl_command-fixture_007] 1'] = 'curl -i -X GET \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" --user admin:admin' -snapshots['test_fixture[build_wget_command-fixture_001] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin' - -snapshots['test_fixture[build_wget_command-fixture_002] 1'] = 'wget -S -O- http://localhost:8080/Plone/folder --header="Accept: application/json" --header="Content-Type: application/json" --post-data=\'{"@type": "Document", "title": "My Document"}\' --auth-no-challenge --user=admin --password=admin' +snapshots['test_fixture[build_curl_command-fixture_008] 1'] = 'curl -i -X GET \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" -H "Accept-Encoding: gzip, deflate" -H "Cookie: zyx 123" -H "If-None-Match: "\'"\'"abc123"\'"\' -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"' -snapshots['test_fixture[build_wget_command-fixture_003] 1'] = 'wget -S -O- --method=PATCH http://localhost:8080/Plone/folder/my-document --header="Accept: application/json" --header="Content-Type: application/json" --body-data=\'{"title": "My New Document Title"}\' --auth-no-challenge --user=admin --password=admin' +snapshots['test_fixture[build_curl_command-fixture_009] 1'] = 'curl -i -X PATCH http://localhost:8080/etc/fstab -H "Accept: application/vnd.acme+json" -H "Accept-Encoding: gzip, deflate" -H "Content-Type: application/vnd.acme+json; charset=utf-8" -H "If-None-Match: "\'"\'"abc123"\'"\' -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ" --data-raw \'{"/": {"fstype": "btrfs", "readonly": true, "storage": {"device": "/dev/sda1", "type": "disk"}}, "/tmp": {"storage": {"sizeInMB": 64, "type": "tmpfs"}}, "/var": {"fstype": "ext4", "options": ["nosuid"], "storage": {"label": "8f3ba6f4-5c70-46ec-83af-0d5434953e5f", "type": "disk"}}, "/var/www": {"storage": {"remotePath": "/exports/mypath", "server": "my.nfs.server", "type": "nfs"}}}\'' -snapshots['test_fixture[build_wget_command-fixture_004] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json"' +snapshots['test_fixture[build_curl_command-fixture_011] 1'] = 'curl -i -X GET \'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc\' -H "Accept: application/json" --user admin:admin' -snapshots['test_fixture[build_wget_command-fixture_005] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json" --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI"' +snapshots['test_fixture[build_curl_command-fixture_012] 1'] = 'curl -i -X POST http://localhost:8080/metrics -H "Accept: application/json" -H "Content-Type: application/json" --data-raw \'{"max": 0.2, "min": 0.1}\' --user admin:admin' -snapshots['test_fixture[build_wget_command-fixture_006] 1'] = 'wget -S -O- --method=PATCH http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f --header="Accept: application/json" --header="Content-Type: application/offset+octet-stream" --header="Tus-Resumable: 1.0.0" --header="Upload-Offset: 3" --body-data=\'defgh\' --auth-no-challenge --user=admin --password=secret' +snapshots['test_fixture[build_curl_command-fixture_013] 1'] = 'curl -i -X POST http://localhost:8080/@@oauth2-token -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" --data-raw \'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED\'' -snapshots['test_fixture[build_wget_command-fixture_007] 1'] = 'wget -S -O- \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin' +snapshots['test_fixture[build_curl_command-fixture_014] 1'] = 'curl -i -X POST http://localhost:8080/@@oauth2-token -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" --data-raw \'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED\'' -snapshots['test_fixture[build_requests_command-fixture_001] 1'] = "requests.get('http://localhost:8080/Plone/front-page', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))" +snapshots['test_fixture[build_httpie_command-fixture_001] 1'] = 'http http://localhost:8080/Plone/front-page Accept:application/json -a admin:admin' -snapshots['test_fixture[build_requests_command-fixture_002] 1'] = "requests.post('http://localhost:8080/Plone/folder', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'@type': 'Document', 'title': 'My Document'}, auth=('admin', 'admin'))" +snapshots['test_fixture[build_httpie_command-fixture_002] 1'] = '''echo '{ + "@type": "Document", + "title": "My Document" +}' | http POST http://localhost:8080/Plone/folder Accept:application/json Content-Type:application/json -a admin:admin''' -snapshots['test_fixture[build_requests_command-fixture_003] 1'] = "requests.patch('http://localhost:8080/Plone/folder/my-document', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'title': 'My New Document Title'}, auth=('admin', 'admin'))" +snapshots['test_fixture[build_httpie_command-fixture_003] 1'] = '''echo '{ + "title": "My New Document Title" +}' | http PATCH http://localhost:8080/Plone/folder/my-document Accept:application/json Content-Type:application/json -a admin:admin''' -snapshots['test_fixture[build_requests_command-fixture_004] 1'] = "requests.get('http://localhost:8080/Plone/front-page', headers={'Accept': 'application/json'})" +snapshots['test_fixture[build_httpie_command-fixture_004] 1'] = 'http http://localhost:8080/Plone/front-page Accept:application/json' -snapshots['test_fixture[build_requests_command-fixture_005] 1'] = "requests.get('http://localhost:8080/Plone/front-page', headers={'Accept': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI'})" +snapshots['test_fixture[build_httpie_command-fixture_005] 1'] = 'http http://localhost:8080/Plone/front-page Accept:application/json Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI"' -snapshots['test_fixture[build_requests_command-fixture_006] 1'] = "requests.patch('http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f', headers={'Accept': 'application/json', 'Content-Type': 'application/offset+octet-stream', 'Tus-Resumable': '1.0.0', 'Upload-Offset': '3'}, data='defgh', auth=('admin', 'secret'))" +snapshots['test_fixture[build_httpie_command-fixture_006] 1'] = 'echo defgh | http PATCH http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f Accept:application/json Content-Type:"application/offset+octet-stream" Tus-Resumable:1.0.0 Upload-Offset:3 -a admin:secret' -snapshots['test_fixture[build_requests_command-fixture_007] 1'] = "requests.get('http://localhost:8080/Plone/front-page?foo=bar&bar=foo', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))" +snapshots['test_fixture[build_httpie_command-fixture_007] 1'] = "http 'http://localhost:8080/Plone/front-page?foo=bar&bar=foo' Accept:application/json -a admin:admin" snapshots['test_fixture[build_httpie_command-fixture_008] 1'] = 'http \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' Accept:application/json Accept-Encoding:"gzip, deflate" Cookie:"zyx 123" If-None-Match:\'"\'"abc123"\'"\' Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"' -snapshots['test_fixture[build_curl_command-fixture_008] 1'] = 'curl -i -X GET \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' -H "Accept: application/json" -H "Accept-Encoding: gzip, deflate" -H "Cookie: zyx 123" -H "If-None-Match: "\'"\'"abc123"\'"\' -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"' - -snapshots['test_fixture[build_wget_command-fixture_008] 1'] = 'wget -S -O- \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' --header="Accept: application/json" --header="Accept-Encoding: gzip, deflate" --header="Cookie: zyx 123" --header="If-None-Match: "\'"\'"abc123"\'"\' --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"' - -snapshots['test_fixture[build_requests_command-fixture_008] 1'] = 'requests.get(\'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\', headers={\'Accept\': \'application/json\', \'Accept-Encoding\': \'gzip, deflate\', \'Cookie\': \'zyx 123\', \'If-None-Match\': \'"abc123"\', \'Authorization\': \'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\'})' - snapshots['test_fixture[build_httpie_command-fixture_009] 1'] = '''echo '{ "/": { "fstype": "btrfs", @@ -110,44 +88,157 @@ } }\' | http PATCH http://localhost:8080/etc/fstab Accept:application/vnd.acme+json Accept-Encoding:"gzip, deflate" Content-Type:"application/vnd.acme+json; charset=utf-8" If-None-Match:\'"\'"abc123"\'"\' Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"''' -snapshots['test_fixture[build_curl_command-fixture_009] 1'] = 'curl -i -X PATCH http://localhost:8080/etc/fstab -H "Accept: application/vnd.acme+json" -H "Accept-Encoding: gzip, deflate" -H "Content-Type: application/vnd.acme+json; charset=utf-8" -H "If-None-Match: "\'"\'"abc123"\'"\' -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ" --data-raw \'{"/": {"fstype": "btrfs", "readonly": true, "storage": {"device": "/dev/sda1", "type": "disk"}}, "/tmp": {"storage": {"sizeInMB": 64, "type": "tmpfs"}}, "/var": {"fstype": "ext4", "options": ["nosuid"], "storage": {"label": "8f3ba6f4-5c70-46ec-83af-0d5434953e5f", "type": "disk"}}, "/var/www": {"storage": {"remotePath": "/exports/mypath", "server": "my.nfs.server", "type": "nfs"}}}\'' +snapshots['test_fixture[build_httpie_command-fixture_011] 1'] = "http 'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc' Accept:application/json -a admin:admin" -snapshots['test_fixture[build_wget_command-fixture_009] 1'] = 'wget -S -O- --method=PATCH http://localhost:8080/etc/fstab --header="Accept: application/vnd.acme+json" --header="Accept-Encoding: gzip, deflate" --header="Content-Type: application/vnd.acme+json; charset=utf-8" --header="If-None-Match: "\'"\'"abc123"\'"\' --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ" --body-data=\'{"/": {"fstype": "btrfs", "readonly": true, "storage": {"device": "/dev/sda1", "type": "disk"}}, "/tmp": {"storage": {"sizeInMB": 64, "type": "tmpfs"}}, "/var": {"fstype": "ext4", "options": ["nosuid"], "storage": {"label": "8f3ba6f4-5c70-46ec-83af-0d5434953e5f", "type": "disk"}}, "/var/www": {"storage": {"remotePath": "/exports/mypath", "server": "my.nfs.server", "type": "nfs"}}}\'' +snapshots['test_fixture[build_httpie_command-fixture_012] 1'] = '''echo '{ + "max": 0.2, + "min": 0.1 +}' | http POST http://localhost:8080/metrics Accept:application/json Content-Type:application/json -a admin:admin''' -snapshots['test_fixture[build_httpie_command-fixture_011] 1'] = "http 'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc' Accept:application/json -a admin:admin" +snapshots['test_fixture[build_httpie_command-fixture_013] 1'] = 'echo \'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED\' | http POST http://localhost:8080/@@oauth2-token Accept:application/json Content-Type:"application/x-www-form-urlencoded"' -snapshots['test_fixture[build_curl_command-fixture_011] 1'] = 'curl -i -X GET \'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc\' -H "Accept: application/json" --user admin:admin' +snapshots['test_fixture[build_httpie_command-fixture_014] 1'] = 'echo \'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED\' | http POST http://localhost:8080/@@oauth2-token Accept:application/json Content-Type:"application/x-www-form-urlencoded"' -snapshots['test_fixture[build_requests_command-fixture_011] 1'] = "requests.get('http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))" +snapshots['test_fixture[build_plone_javascript_command-fixture_001] 1'] = '''createAliasesMutation +| +const aliasesData = '';''' -snapshots['test_fixture[build_wget_command-fixture_011] 1'] = 'wget -S -O- \'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc\' --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin' +snapshots['test_fixture[build_plone_javascript_command-fixture_002] 1'] = '''createAliasesMutation +| +const aliasesData = '{ + "@type": "Document", + "title": "My Document" +}';''' -snapshots['test_fixture[build_httpie_command-fixture_012] 1'] = '''echo '{ +snapshots['test_fixture[build_plone_javascript_command-fixture_003] 1'] = '''createAliasesMutation +| +const aliasesData = '{ + "title": "My New Document Title" +}';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_004] 1'] = '''createAliasesMutation +| +const aliasesData = '';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_005] 1'] = '''createAliasesMutation +| +const aliasesData = '';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_006] 1'] = '''createAliasesMutation +| +const aliasesData = 'defgh';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_007] 1'] = '''createAliasesMutation +| +const aliasesData = '';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_008] 1'] = '''createAliasesMutation +| +const aliasesData = '';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_009] 1'] = '''createAliasesMutation +| +const aliasesData = '{ + "/": { + "fstype": "btrfs", + "readonly": true, + "storage": { + "device": "/dev/sda1", + "type": "disk" + } + }, + "/tmp": { + "storage": { + "sizeInMB": 64, + "type": "tmpfs" + } + }, + "/var": { + "fstype": "ext4", + "options": [ + "nosuid" + ], + "storage": { + "label": "8f3ba6f4-5c70-46ec-83af-0d5434953e5f", + "type": "disk" + } + }, + "/var/www": { + "storage": { + "remotePath": "/exports/mypath", + "server": "my.nfs.server", + "type": "nfs" + } + } +}';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_011] 1'] = '''createAliasesMutation +| +const aliasesData = '';''' + +snapshots['test_fixture[build_plone_javascript_command-fixture_012] 1'] = '''createAliasesMutation +| +const aliasesData = '{ "max": 0.2, "min": 0.1 -}' | http POST http://localhost:8080/metrics Accept:application/json Content-Type:application/json -a admin:admin''' +}';''' -snapshots['test_fixture[build_curl_command-fixture_012] 1'] = 'curl -i -X POST http://localhost:8080/metrics -H "Accept: application/json" -H "Content-Type: application/json" --data-raw \'{"max": 0.2, "min": 0.1}\' --user admin:admin' +snapshots['test_fixture[build_plone_javascript_command-fixture_013] 1'] = '''createAliasesMutation +| +const aliasesData = 'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED';''' -snapshots['test_fixture[build_wget_command-fixture_012] 1'] = 'wget -S -O- http://localhost:8080/metrics --header="Accept: application/json" --header="Content-Type: application/json" --post-data=\'{"max": 0.2, "min": 0.1}\' --auth-no-challenge --user=admin --password=admin' +snapshots['test_fixture[build_plone_javascript_command-fixture_014] 1'] = '''createAliasesMutation +| +const aliasesData = 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED';''' -snapshots['test_fixture[build_requests_command-fixture_012] 1'] = "requests.post('http://localhost:8080/metrics', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'max': 0.2, 'min': 0.1}, auth=('admin', 'admin'))" +snapshots['test_fixture[build_requests_command-fixture_001] 1'] = "requests.get('http://localhost:8080/Plone/front-page', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))" -snapshots['test_fixture[build_requests_command-fixture_009] 1'] = 'requests.patch(\'http://localhost:8080/etc/fstab\', headers={\'Accept\': \'application/vnd.acme+json\', \'Accept-Encoding\': \'gzip, deflate\', \'Content-Type\': \'application/vnd.acme+json; charset=utf-8\', \'If-None-Match\': \'"abc123"\', \'Authorization\': \'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\'}, json={\'/\': {\'fstype\': \'btrfs\', \'readonly\': True, \'storage\': {\'device\': \'/dev/sda1\', \'type\': \'disk\'}}, \'/tmp\': {\'storage\': {\'sizeInMB\': 64, \'type\': \'tmpfs\'}}, \'/var\': {\'fstype\': \'ext4\', \'options\': [\'nosuid\'], \'storage\': {\'label\': \'8f3ba6f4-5c70-46ec-83af-0d5434953e5f\', \'type\': \'disk\'}}, \'/var/www\': {\'storage\': {\'remotePath\': \'/exports/mypath\', \'server\': \'my.nfs.server\', \'type\': \'nfs\'}}})' +snapshots['test_fixture[build_requests_command-fixture_002] 1'] = "requests.post('http://localhost:8080/Plone/folder', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'@type': 'Document', 'title': 'My Document'}, auth=('admin', 'admin'))" -snapshots['test_fixture[build_httpie_command-fixture_013] 1'] = 'echo \'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED\' | http POST http://localhost:8080/@@oauth2-token Accept:application/json Content-Type:"application/x-www-form-urlencoded"' +snapshots['test_fixture[build_requests_command-fixture_003] 1'] = "requests.patch('http://localhost:8080/Plone/folder/my-document', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'title': 'My New Document Title'}, auth=('admin', 'admin'))" -snapshots['test_fixture[build_curl_command-fixture_013] 1'] = 'curl -i -X POST http://localhost:8080/@@oauth2-token -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" --data-raw \'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED\'' +snapshots['test_fixture[build_requests_command-fixture_004] 1'] = "requests.get('http://localhost:8080/Plone/front-page', headers={'Accept': 'application/json'})" -snapshots['test_fixture[build_wget_command-fixture_013] 1'] = 'wget -S -O- http://localhost:8080/@@oauth2-token --header="Accept: application/json" --header="Content-Type: application/x-www-form-urlencoded" --post-data=\'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED\'' +snapshots['test_fixture[build_requests_command-fixture_005] 1'] = "requests.get('http://localhost:8080/Plone/front-page', headers={'Accept': 'application/json', 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI'})" -snapshots['test_fixture[build_requests_command-fixture_013] 1'] = "requests.post('http://localhost:8080/@@oauth2-token', headers={'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}, data={'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer', 'assertion': 'REDACTED'})" +snapshots['test_fixture[build_requests_command-fixture_006] 1'] = "requests.patch('http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f', headers={'Accept': 'application/json', 'Content-Type': 'application/offset+octet-stream', 'Tus-Resumable': '1.0.0', 'Upload-Offset': '3'}, data='defgh', auth=('admin', 'secret'))" -snapshots['test_fixture[build_httpie_command-fixture_014] 1'] = 'echo \'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED\' | http POST http://localhost:8080/@@oauth2-token Accept:application/json Content-Type:"application/x-www-form-urlencoded"' +snapshots['test_fixture[build_requests_command-fixture_007] 1'] = "requests.get('http://localhost:8080/Plone/front-page?foo=bar&bar=foo', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))" -snapshots['test_fixture[build_curl_command-fixture_014] 1'] = 'curl -i -X POST http://localhost:8080/@@oauth2-token -H "Accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" --data-raw \'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED\'' +snapshots['test_fixture[build_requests_command-fixture_008] 1'] = 'requests.get(\'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\', headers={\'Accept\': \'application/json\', \'Accept-Encoding\': \'gzip, deflate\', \'Cookie\': \'zyx 123\', \'If-None-Match\': \'"abc123"\', \'Authorization\': \'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\'})' -snapshots['test_fixture[build_wget_command-fixture_014] 1'] = 'wget -S -O- http://localhost:8080/@@oauth2-token --header="Accept: application/json" --header="Content-Type: application/x-www-form-urlencoded" --post-data=\'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED\'' +snapshots['test_fixture[build_requests_command-fixture_009] 1'] = 'requests.patch(\'http://localhost:8080/etc/fstab\', headers={\'Accept\': \'application/vnd.acme+json\', \'Accept-Encoding\': \'gzip, deflate\', \'Content-Type\': \'application/vnd.acme+json; charset=utf-8\', \'If-None-Match\': \'"abc123"\', \'Authorization\': \'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ\'}, json={\'/\': {\'fstype\': \'btrfs\', \'readonly\': True, \'storage\': {\'device\': \'/dev/sda1\', \'type\': \'disk\'}}, \'/tmp\': {\'storage\': {\'sizeInMB\': 64, \'type\': \'tmpfs\'}}, \'/var\': {\'fstype\': \'ext4\', \'options\': [\'nosuid\'], \'storage\': {\'label\': \'8f3ba6f4-5c70-46ec-83af-0d5434953e5f\', \'type\': \'disk\'}}, \'/var/www\': {\'storage\': {\'remotePath\': \'/exports/mypath\', \'server\': \'my.nfs.server\', \'type\': \'nfs\'}}})' + +snapshots['test_fixture[build_requests_command-fixture_011] 1'] = "requests.get('http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc', headers={'Accept': 'application/json'}, auth=('admin', 'admin'))" + +snapshots['test_fixture[build_requests_command-fixture_012] 1'] = "requests.post('http://localhost:8080/metrics', headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, json={'max': 0.2, 'min': 0.1}, auth=('admin', 'admin'))" + +snapshots['test_fixture[build_requests_command-fixture_013] 1'] = "requests.post('http://localhost:8080/@@oauth2-token', headers={'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}, data={'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer', 'assertion': 'REDACTED'})" snapshots['test_fixture[build_requests_command-fixture_014] 1'] = "requests.post('http://localhost:8080/@@oauth2-token', headers={'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}, data={'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer', 'assertion': 'REDACTED'})" +snapshots['test_fixture[build_wget_command-fixture_001] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin' + +snapshots['test_fixture[build_wget_command-fixture_002] 1'] = 'wget -S -O- http://localhost:8080/Plone/folder --header="Accept: application/json" --header="Content-Type: application/json" --post-data=\'{"@type": "Document", "title": "My Document"}\' --auth-no-challenge --user=admin --password=admin' + +snapshots['test_fixture[build_wget_command-fixture_003] 1'] = 'wget -S -O- --method=PATCH http://localhost:8080/Plone/folder/my-document --header="Accept: application/json" --header="Content-Type: application/json" --body-data=\'{"title": "My New Document Title"}\' --auth-no-challenge --user=admin --password=admin' + +snapshots['test_fixture[build_wget_command-fixture_004] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json"' + +snapshots['test_fixture[build_wget_command-fixture_005] 1'] = 'wget -S -O- http://localhost:8080/Plone/front-page --header="Accept: application/json" --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmdWxsbmFtZSI6IiIsInN1YiI6ImFkbWluIiwiZXhwIjoxNDY0MDQyMTAzfQ.aOyvMwdcIMV6pzC0GYQ3ZMdGaHR1_W7DxT0W0ok4FxI"' + +snapshots['test_fixture[build_wget_command-fixture_006] 1'] = 'wget -S -O- --method=PATCH http://nohost/plone/folder/@upload/032803b64ad746b3ab46d9223ea3d90f --header="Accept: application/json" --header="Content-Type: application/offset+octet-stream" --header="Tus-Resumable: 1.0.0" --header="Upload-Offset: 3" --body-data=\'defgh\' --auth-no-challenge --user=admin --password=secret' + +snapshots['test_fixture[build_wget_command-fixture_007] 1'] = 'wget -S -O- \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin' + +snapshots['test_fixture[build_wget_command-fixture_008] 1'] = 'wget -S -O- \'http://localhost:8080/Plone/front-page?foo=bar&bar=foo\' --header="Accept: application/json" --header="Accept-Encoding: gzip, deflate" --header="Cookie: zyx 123" --header="If-None-Match: "\'"\'"abc123"\'"\' --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ"' + +snapshots['test_fixture[build_wget_command-fixture_009] 1'] = 'wget -S -O- --method=PATCH http://localhost:8080/etc/fstab --header="Accept: application/vnd.acme+json" --header="Accept-Encoding: gzip, deflate" --header="Content-Type: application/vnd.acme+json; charset=utf-8" --header="If-None-Match: "\'"\'"abc123"\'"\' --header="Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ" --body-data=\'{"/": {"fstype": "btrfs", "readonly": true, "storage": {"device": "/dev/sda1", "type": "disk"}}, "/tmp": {"storage": {"sizeInMB": 64, "type": "tmpfs"}}, "/var": {"fstype": "ext4", "options": ["nosuid"], "storage": {"label": "8f3ba6f4-5c70-46ec-83af-0d5434953e5f", "type": "disk"}}, "/var/www": {"storage": {"remotePath": "/exports/mypath", "server": "my.nfs.server", "type": "nfs"}}}\'' + +snapshots['test_fixture[build_wget_command-fixture_011] 1'] = 'wget -S -O- \'http://localhost/items?user_id=12&user_id=13&from=20170101&to=20171231&user_id=15&limit=20&sort=date-asc\' --header="Accept: application/json" --auth-no-challenge --user=admin --password=admin' + +snapshots['test_fixture[build_wget_command-fixture_012] 1'] = 'wget -S -O- http://localhost:8080/metrics --header="Accept: application/json" --header="Content-Type: application/json" --post-data=\'{"max": 0.2, "min": 0.1}\' --auth-no-challenge --user=admin --password=admin' + +snapshots['test_fixture[build_wget_command-fixture_013] 1'] = 'wget -S -O- http://localhost:8080/@@oauth2-token --header="Accept: application/json" --header="Content-Type: application/x-www-form-urlencoded" --post-data=\'grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=REDACTED\'' + +snapshots['test_fixture[build_wget_command-fixture_014] 1'] = 'wget -S -O- http://localhost:8080/@@oauth2-token --header="Accept: application/json" --header="Content-Type: application/x-www-form-urlencoded" --post-data=\'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REDACTED\'' diff --git a/tests/test_builders.py b/tests/test_builders.py index 603cf51..aff546a 100644 --- a/tests/test_builders.py +++ b/tests/test_builders.py @@ -16,6 +16,7 @@ from sphinxcontrib.httpexample.builders import build_httpie_command from sphinxcontrib.httpexample.builders import build_requests_command from sphinxcontrib.httpexample.builders import build_wget_command +from sphinxcontrib.httpexample.builders import build_plone_javascript_command from sphinxcontrib.httpexample.parsers import parse_request import pytest @@ -48,6 +49,7 @@ build_curl_command, build_wget_command, build_requests_command, + build_plone_javascript_command, ), ids=lambda fn: fn.__name__) def test_fixture(request_fixture, builder, snapshot): command = builder(parse_request(request_fixture['data']))