Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 14 additions & 24 deletions comtypes/test/test_casesensitivity.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
import contextlib
import unittest

from comtypes.client import GetModule

iem = GetModule("shdocvw.dll")
with contextlib.redirect_stdout(None): # supress warnings
GetModule("msvidctl.dll")
from comtypes.gen import MSVidCtlLib as msvidctl


class TestCase(unittest.TestCase):
def test(self):
from comtypes.client import GetModule

iem = GetModule("shdocvw.dll")

# IDispatch(IUnknown)
# IWebBrowser(IDispatch)
# IWebBrowserApp(IWebBrowser)
# IWebBrowser2(IWebBrowserApp)

# print iem.IWebBrowser2.mro()

self.assertTrue(issubclass(iem.IWebBrowser2, iem.IWebBrowserApp))
self.assertTrue(issubclass(iem.IWebBrowserApp, iem.IWebBrowser))
# IMSVidDevice(IDispatch)
# IMSVidInputDevice(IMSVidDevice)
# IMSVidPlayback(IMSVidOutputDevice)

# print sorted(iem.IWebBrowser.__map_case__.keys())
# print "=" * 42
# print sorted(iem.IWebBrowserApp.__map_case__.keys())
# print "=" * 42
# print sorted(iem.IWebBrowser2.__map_case__.keys())
# print "=" * 42
self.assertTrue(issubclass(msvidctl.IMSVidPlayback, msvidctl.IMSVidInputDevice))
self.assertTrue(issubclass(msvidctl.IMSVidInputDevice, msvidctl.IMSVidDevice))

# names in the base class __map_case__ must also appear in the
# subclass.
for name in iem.IWebBrowser.__map_case__:
self.assertTrue(name in iem.IWebBrowserApp.__map_case__, f"{name} missing")
self.assertTrue(name in iem.IWebBrowser2.__map_case__, f"{name} missing")
for name in msvidctl.IMSVidDevice.__map_case__:
self.assertIn(name, msvidctl.IMSVidInputDevice.__map_case__)
self.assertIn(name, msvidctl.IMSVidPlayback.__map_case__)

for name in iem.IWebBrowserApp.__map_case__:
self.assertTrue(name in iem.IWebBrowser2.__map_case__, f"{name} missing")
for name in msvidctl.IMSVidInputDevice.__map_case__:
self.assertIn(name, msvidctl.IMSVidPlayback.__map_case__)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@


def setUpModule():
# The primary goal is to verify how `GetEvents` behaves when the
# `interface` argument is explicitly specified versus when it is omitted,
# using an object that has multiple outgoing event interfaces.
raise ut.SkipTest(
"External test dependencies like this seem bad. Find a different built-in "
"win32 API to use."
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ignore = ["E402"]
"comtypes/test/test_agilent.py" = ["F401", "F841"]
"comtypes/test/test_client.py" = ["F401"]
"comtypes/test/test_dict.py" = ["F841"]
"comtypes/test/test_ie.py" = ["F841"]
"comtypes/test/test_eventinterface.py" = ["F841"]
"comtypes/test/test_outparam.py" = ["F841"]
"comtypes/test/test_sapi.py" = ["E401"]
"comtypes/test/test_server.py" = ["F401", "F841"]
Expand Down