Skip to content

Commit

Permalink
Update tests following the switch from m2r to mdinclude
Browse files Browse the repository at this point in the history
Two kind of changes are required to adjust the tests after the move from
m2r to mdinclude for parsing Markdown.

- We need to slightly adjust the expected results for the
  uber.json/uber.yaml tests, because of minor differences in formatting
  between m2r and mdinclude (namely, spaces before/after the inserted
  role markers).

- Alas, we also need to adjust the base JSON/YAML files themselves,
  because it appears that mdinclude (itself or through its mistune
  dependency, I'm not sure, see [0] and [1]) does not support simple
  HTML tags without slash (e.g. "<div>...</div>" works, "<br />" too,
  but not simply "<br>").

[0] https://github.com/lepture/mistune/blob/693db5c/mistune/inline_parser.py#L32
[1] https://github.com/amyreese/sphinx-mdinclude/blob/3636e33fe83cfcfea14e70fd503777ceb11f4401/sphinx_mdinclude/parse.py#L62
  • Loading branch information
qmonnet committed Nov 29, 2022
1 parent 35bd6a0 commit a65289f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/renderers/httpdomain/rendered/v2.0/uber.json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
:format: html


The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.\ :raw-html-md:`<br>`\ :raw-html-md:`<br>`\ The response also includes low and high estimates, and the `ISO 4217 <http://en.wikipedia.org/wiki/ISO_4217>`_ currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.:raw-html-md:`<br />`:raw-html-md:`<br />`The response also includes low and high estimates, and the `ISO 4217 <http://en.wikipedia.org/wiki/ISO_4217>`_ currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.

:queryparam start_latitude:
Latitude component of start location.
Expand Down Expand Up @@ -158,7 +158,7 @@
:format: html


The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.\ :raw-html-md:`<br>`\ :raw-html-md:`<br>`\ The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.:raw-html-md:`<br />`:raw-html-md:`<br />`The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.

:queryparam offset:
Offset the list of returned results by this amount. Default is zero.
Expand Down
4 changes: 2 additions & 2 deletions tests/renderers/httpdomain/rendered/v2.0/uber.yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
:format: html


The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.\ :raw-html-md:`<br>`\ :raw-html-md:`<br>`\ The response also includes low and high estimates, and the `ISO 4217 <http://en.wikipedia.org/wiki/ISO_4217>`_ currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.:raw-html-md:`<br />`:raw-html-md:`<br />`The response also includes low and high estimates, and the `ISO 4217 <http://en.wikipedia.org/wiki/ISO_4217>`_ currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.

:queryparam start_latitude:
Latitude component of start location.
Expand Down Expand Up @@ -158,7 +158,7 @@
:format: html


The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.\ :raw-html-md:`<br>`\ :raw-html-md:`<br>`\ The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.:raw-html-md:`<br />`:raw-html-md:`<br />`The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.

:queryparam offset:
Offset the list of returned results by this amount. Default is zero.
Expand Down
4 changes: 2 additions & 2 deletions tests/testspecs/v2.0/uber.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"/estimates/price": {
"get": {
"summary": "Price Estimates",
"description": "The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br><br>The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.",
"description": "The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br /><br />The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.",
"parameters": [
{
"name": "start_latitude",
Expand Down Expand Up @@ -201,7 +201,7 @@
"/history": {
"get": {
"summary": "User Activity",
"description": "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.",
"description": "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br /><br />The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.",
"parameters": [
{
"name": "offset",
Expand Down
4 changes: 2 additions & 2 deletions tests/testspecs/v2.0/uber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ paths:
/estimates/price:
get:
summary: Price Estimates
description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br><br>The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
description: The Price Estimates endpoint returns an estimated price range for each product offered at a given location. The price estimate is provided as a formatted string with the full price range and the localized currency symbol.<br /><br />The response also includes low and high estimates, and the [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code for situations requiring currency conversion. When surge is active for a particular product, its surge_multiplier will be greater than 1, but the price estimate already factors in this multiplier.
parameters:
- name: start_latitude
in: query
Expand Down Expand Up @@ -151,7 +151,7 @@ paths:
/history:
get:
summary: User Activity
description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br /><br />The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
parameters:
- name: offset
in: query
Expand Down

0 comments on commit a65289f

Please sign in to comment.