|
1 |
| -from typing import List, Union |
| 1 | +import sys |
| 2 | +from os.path import dirname, abspath, join |
2 | 3 |
|
3 | 4 | import pytest
|
| 5 | +import typing |
| 6 | + |
| 7 | +from robotlibcore import RF32 |
| 8 | + |
| 9 | +from typing import List, Union |
4 | 10 |
|
| 11 | +curdir = dirname(abspath(__file__)) |
| 12 | +atest_dir = join(curdir, '..', 'atest') |
| 13 | +src = join(curdir, '..', 'src') |
| 14 | +sys.path.insert(0, src) |
| 15 | +sys.path.insert(0, atest_dir) |
5 | 16 | from DynamicTypesAnnotationsLibrary import DynamicTypesAnnotationsLibrary
|
6 | 17 | from DynamicTypesAnnotationsLibrary import CustomObject
|
7 | 18 | from DynamicTypesLibrary import DynamicTypesLibrary
|
@@ -182,6 +193,15 @@ def test_keyword_with_decorator_arguments(lib_types):
|
182 | 193 | assert types == {'arg1': bool, 'arg2': bool}
|
183 | 194 |
|
184 | 195 |
|
185 |
| -def test_keyword_optional_with_none_1(lib_types): |
186 |
| - types = lib_types.get_keyword_types('keyword_optional_with_none') |
187 |
| - assert types == {'arg': Union[str, type(None)]} |
| 196 | +@pytest.mark.skipif(RF32, reason='Only for RF4+') |
| 197 | +def test_keyword_optional_with_none_rf32(lib_types): |
| 198 | + lib = DynamicTypesAnnotationsLibrary("111") |
| 199 | + types = lib.get_keyword_types('keyword_optional_with_none') |
| 200 | + assert types == {'arg': typing.Union[str, type(None)]} |
| 201 | + |
| 202 | + |
| 203 | +@pytest.mark.skipif(not RF32, reason='Only for RF3.2+') |
| 204 | +def test_keyword_optional_with_none_rf32(lib_types): |
| 205 | + lib = DynamicTypesAnnotationsLibrary("111") |
| 206 | + types = lib.get_keyword_types('keyword_optional_with_none') |
| 207 | + assert types == {'arg': str} |
0 commit comments