mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Expose INVALID_HANDLE_VALUE as mobase.INVALID_HANDLE_VALUE. (#131)
* Expose INVALID_HANDLE_VALUE as mobase.INVALID_HANDLE_VALUE. * Add tests for startApplication() returning INVALID_HANDLE_VALUE. * Clean tests and generate stub files for them.
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
import pytest
|
||||
|
||||
import mobase
|
||||
|
||||
m = pytest.importorskip("mobase_tests.argument_wrapper")
|
||||
import mobase_tests.argument_wrapper as m
|
||||
|
||||
|
||||
def test_argument_wrapper_fn1():
|
||||
assert m.fn1_raw("hello") == "hello-hello"
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
m.fn1_raw(1)
|
||||
m.fn1_raw(1) # pyright: ignore[reportArgumentType]
|
||||
|
||||
assert m.fn1_wrap("hello") == "hello-hello"
|
||||
assert m.fn1_wrap(32) == "32-32"
|
||||
@@ -22,7 +20,7 @@ def test_argument_wrapper_fn2():
|
||||
assert m.fn2_raw(33) == 66
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
m.fn2_raw("12")
|
||||
m.fn2_raw("12") # pyright: ignore[reportArgumentType]
|
||||
|
||||
assert m.fn2_wrap("15") == 30
|
||||
assert m.fn2_wrap(32) == 64
|
||||
@@ -36,10 +34,10 @@ def test_argument_wrapper_fn3():
|
||||
assert m.fn3_raw(33, [1, 2], "hello") == "hello-35"
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
m.fn3_raw("12", [], "hello")
|
||||
m.fn3_raw("12", [], "hello") # pyright: ignore[reportArgumentType]
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
m.fn3_raw(36, [], 136)
|
||||
m.fn3_raw(36, [], 136) # pyright: ignore[reportArgumentType]
|
||||
|
||||
assert m.fn3_wrap(14, [1, 2], "world") == "world-16"
|
||||
assert m.fn3_wrap("15", [0], "woot") == "woot-16"
|
||||
@@ -55,10 +53,10 @@ def test_argument_wrapper_fn3():
|
||||
assert m.fn3_wrap_0("15", [], "w00t") == "w00t-15"
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
m.fn3_wrap_0(14, [], 12)
|
||||
m.fn3_wrap_0(14, [], 12) # pyright: ignore[reportArgumentType]
|
||||
|
||||
assert m.fn3_wrap_2(14, [1, 2], "world") == "world-16"
|
||||
assert m.fn3_wrap_2(15, [], 18) == "18-15"
|
||||
|
||||
with pytest.raises(TypeError):
|
||||
m.fn3_wrap_2("14", [], 12)
|
||||
m.fn3_wrap_2("14", [], 12) # pyright: ignore[reportArgumentType]
|
||||
|
||||
Reference in New Issue
Block a user