Test the ``_get_minimum_versions`` method. The method should return the minimum versions of the dependencies for the given python version. If a library is linked to an URL, the minimum version should be the URL.
()
| 4 | |
| 5 | |
| 6 | def test_get_minimum_versions(): |
| 7 | """Test the ``_get_minimum_versions`` method. |
| 8 | |
| 9 | The method should return the minimum versions of the dependencies for the given python version. |
| 10 | If a library is linked to an URL, the minimum version should be the URL. |
| 11 | """ |
| 12 | # Setup |
| 13 | dependencies = [ |
| 14 | "numpy>=1.20.0,<2;python_version<'3.10'", |
| 15 | "numpy>=1.23.3,<2;python_version>='3.10'", |
| 16 | "pandas>=1.2.0,<2;python_version<'3.10'", |
| 17 | "pandas>=1.3.0,<2;python_version>='3.10'", |
| 18 | 'humanfriendly>=8.2,<11', |
| 19 | 'pandas @ git+https://github.com/pandas-dev/pandas.git@master', |
| 20 | ] |
| 21 | |
| 22 | # Run |
| 23 | minimum_versions_39 = _get_minimum_versions(dependencies, '3.9') |
| 24 | minimum_versions_310 = _get_minimum_versions(dependencies, '3.10') |
| 25 | |
| 26 | # Assert |
| 27 | expected_versions_39 = [ |
| 28 | 'numpy==1.20.0', |
| 29 | 'git+https://github.com/pandas-dev/pandas.git@master#egg=pandas', |
| 30 | 'humanfriendly==8.2', |
| 31 | ] |
| 32 | expected_versions_310 = [ |
| 33 | 'numpy==1.23.3', |
| 34 | 'git+https://github.com/pandas-dev/pandas.git@master#egg=pandas', |
| 35 | 'humanfriendly==8.2', |
| 36 | ] |
| 37 | |
| 38 | assert minimum_versions_39 == expected_versions_39 |
| 39 | assert minimum_versions_310 == expected_versions_310 |
nothing calls this directly
no test coverage detected