-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
…lection Signed-off-by: Jos Verlinde <Jos.Verlinde@microsoft.com>
- Loading branch information
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
from pathlib import Path | ||
from typing import List, Union | ||
|
||
import pytest | ||
from stubber.codemod.enrich import merge_candidates | ||
from stubber.publish.candidates import board_candidates | ||
|
||
pytestmark = [pytest.mark.stubber] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"family, versions", | ||
[ | ||
("micropython", "v1.22.0"), | ||
("micropython", "preview"), | ||
# Add more test cases here | ||
], | ||
) | ||
def test_board_candidates(family: str, versions: Union[str, List[str]]): | ||
|
||
candidates = list(board_candidates(family=family, versions=versions)) | ||
assert len(candidates) > 0 | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"id, source, target, count", | ||
[ | ||
( | ||
10, | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs", | ||
"tests/data/stub_merge/micropython-v1_24_1-rp2-RPI_PICO", | ||
55, | ||
), | ||
( | ||
11, | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs", | ||
"tests/data/stub_merge/micropython-v1_24_1-rp2-RPI_PICO/machine.pyi", | ||
18, | ||
), | ||
( | ||
12, | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs", | ||
"tests/data/stub_merge/micropython-v1_24_1-rp2-RPI_PICO/umachine.pyi", | ||
0, | ||
), | ||
( | ||
13, | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs", | ||
"tests/data/stub_merge/micropython-v1_24_1-rp2-RPI_PICO/micropython.pyi", | ||
1, | ||
), | ||
( | ||
23, | ||
"repos/micropython-stubs/micropython-reference", | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs", | ||
94, | ||
), | ||
( | ||
24, | ||
"repos/micropython-stubs/micropython-reference", | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs/machine", | ||
17, | ||
), | ||
( | ||
25, | ||
"repos/micropython-stubs/micropython-reference", | ||
"tests/data/stub_merge/micropython-v1_24_1-docstubs/machine/__init__.pyi", | ||
1, | ||
), | ||
# Add more test cases here | ||
], | ||
) | ||
def test_merge_candidates(id, source, target, count): | ||
|
||
result = merge_candidates(Path(source), Path(target)) | ||
assert len(result) == count | ||
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.12 on ubuntu-latest
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.9 on ubuntu-latest
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.11 on ubuntu-latest
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.8 on ubuntu-latest
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.10 on ubuntu-latest
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.8 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.8 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.12 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.12 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.11 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.11 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.10 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.10 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.9 on macos-13
Check failure on line 76 in tests/merge/test_candidates.py GitHub Actions / Python 3.9 on macos-13
|