Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gen_release_notes_test.py 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright © 2019 Intel Corporation
  2. # Permission is hereby granted, free of charge, to any person obtaining a copy
  3. # of this software and associated documentation files (the "Software"), to deal
  4. # in the Software without restriction, including without limitation the rights
  5. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6. # copies of the Software, and to permit persons to whom the Software is
  7. # furnished to do so, subject to the following conditions:
  8. # The above copyright notice and this permission notice shall be included in
  9. # all copies or substantial portions of the Software.
  10. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  16. # SOFTWARE.
  17. from unittest import mock
  18. import pytest
  19. from .gen_release_notes import *
  20. @pytest.mark.parametrize(
  21. 'current, is_point, expected',
  22. [
  23. ('19.2.0', True, '19.2.1'),
  24. ('19.3.6', True, '19.3.7'),
  25. ('20.0.0-rc4', False, '20.0.0'),
  26. ])
  27. def test_next_version(current: str, is_point: bool, expected: str) -> None:
  28. assert calculate_next_version(current, is_point) == expected
  29. @pytest.mark.parametrize(
  30. 'current, is_point, expected',
  31. [
  32. ('19.3.6', True, '19.3.6'),
  33. ('20.0.0-rc4', False, '19.3.0'),
  34. ])
  35. def test_previous_version(current: str, is_point: bool, expected: str) -> None:
  36. assert calculate_previous_version(current, is_point) == expected
  37. @pytest.mark.asyncio
  38. async def test_get_shortlog():
  39. # Certainly not perfect, but it's something
  40. version = '19.2.0'
  41. out = await get_shortlog(version)
  42. assert out
  43. @pytest.mark.asyncio
  44. async def test_gather_commits():
  45. # Certainly not perfect, but it's something
  46. version = '19.2.0'
  47. out = await gather_commits(version)
  48. assert out