"Fossies" - the Fresh Open Source Software Archive

Member "mesa-20.1.8/bin/gen_release_notes_test.py" (16 Sep 2020, 2160 Bytes) of package /linux/misc/mesa-20.1.8.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "gen_release_notes_test.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 20.1.5_vs_20.2.0-rc1.

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