comtypes 1.4.8__zip → 1.4.9__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {comtypes-1.4.8 → comtypes-1.4.9}/CHANGES.txt +21 -0
- {comtypes-1.4.8/comtypes.egg-info → comtypes-1.4.9}/PKG-INFO +2 -2
- {comtypes-1.4.8 → comtypes-1.4.9}/README.md +1 -1
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/GUID.py +6 -5
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/__init__.py +16 -5
- comtypes-1.4.9/comtypes/_comobject.py +507 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_memberspec.py +80 -8
- comtypes-1.4.9/comtypes/_post_coinit/_cominterface_meta_patcher.py +153 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_post_coinit/misc.py +1 -1
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_post_coinit/unknwn.py +25 -171
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_safearray.py +1 -2
- comtypes-1.4.9/comtypes/_vtbl.py +448 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/automation.py +36 -45
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/_code_cache.py +4 -4
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/_constants.py +1 -1
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/_events.py +1 -1
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/_generate.py +4 -8
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/lazybind.py +2 -2
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/errorinfo.py +3 -3
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/git.py +1 -2
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/hints.pyi +7 -15
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/safearray.py +10 -0
- comtypes-1.4.9/comtypes/server/__init__.py +86 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/server/inprocserver.py +22 -17
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/server/localserver.py +28 -16
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/server/register.py +61 -73
- comtypes-1.4.9/comtypes/server/w_getopt.py +48 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/shelllink.py +3 -26
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/__init__.py +9 -11
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_BSTR.py +4 -7
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_avmc.py +1 -1
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_casesensitivity.py +3 -5
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_collections.py +3 -3
- comtypes-1.4.9/comtypes/test/test_comobject.py +146 -0
- comtypes-1.4.9/comtypes/test/test_comserver.py +319 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_createwrappers.py +2 -4
- comtypes-1.4.9/comtypes/test/test_dispinterface.py +153 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_excel.py +22 -12
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_ie.py +2 -5
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_inout_args.py +7 -4
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_midl_safearray_create.py +9 -1
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_outparam.py +17 -10
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_safearray.py +1 -90
- comtypes-1.4.9/comtypes/test/test_server.py +350 -0
- comtypes-1.4.9/comtypes/test/test_server_register.py +536 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_showevents.py +7 -17
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_variant.py +0 -17
- comtypes-1.4.9/comtypes/test/test_w_getopt.py +29 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_win32com_interop.py +80 -36
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_wmi.py +0 -3
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/codegenerator.py +62 -68
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/helpers.py +8 -8
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/packing.py +4 -4
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/typeannotator.py +7 -7
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/typedesc.py +1 -6
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/typeinfo.py +11 -22
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/viewobject.py +1 -5
- {comtypes-1.4.8 → comtypes-1.4.9/comtypes.egg-info}/PKG-INFO +2 -2
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes.egg-info/SOURCES.txt +6 -3
- {comtypes-1.4.8 → comtypes-1.4.9}/pyproject.toml +1 -0
- comtypes-1.4.8/comtypes/_comobject.py +0 -833
- comtypes-1.4.8/comtypes/_idl_stuff.py +0 -67
- comtypes-1.4.8/comtypes/server/__init__.py +0 -70
- comtypes-1.4.8/comtypes/server/w_getopt.py +0 -75
- comtypes-1.4.8/comtypes/test/test_comserver.py +0 -239
- comtypes-1.4.8/comtypes/test/test_dispinterface.py +0 -137
- comtypes-1.4.8/comtypes/test/test_propputref.py +0 -40
- comtypes-1.4.8/comtypes/test/test_server.py +0 -354
- {comtypes-1.4.8 → comtypes-1.4.9}/LICENSE.txt +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/MANIFEST.in +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_meta.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_npsupport.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_post_coinit/__init__.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_post_coinit/bstr.py +0 -0
- /comtypes-1.4.8/comtypes/_py_instance_method.py → /comtypes-1.4.9/comtypes/_post_coinit/instancemethod.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/_tlib_version_checker.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/clear_cache.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/__init__.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/client/dynamic.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/connectionpoints.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/hresult.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/logutil.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/messageloop.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/patcher.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/persist.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/server/automation.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/server/connectionpoints.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/stream.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/TestComServer.idl +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/TestComServer.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/TestComServer.tlb +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/TestDispServer.idl +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/TestDispServer.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/TestDispServer.tlb +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/find_memleak.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/mylib.idl +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/mylib.tlb +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/mytypelib.idl +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/runtests.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/setup.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_DISPPARAMS.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_GUID.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_QueryService.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_agilent.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_basic.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_clear_cache.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_client.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_client_dynamic.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_client_regenerate_modules.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_dict.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_dispifc_records.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_dispifc_safearrays.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_dyndispatch.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_findgendir.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_getactiveobj.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_ienum.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_imfattributes.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_jscript.js +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_monikers.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_msscript.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_npsupport.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_persist.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_pump_events.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_recordinfo.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_sapi.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_shelllink.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_storage.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_stream.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_subinterface.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_typeannotator.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_typeinfo.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_urlhistory.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/test_word.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/test/urlhist.tlb +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/__init__.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/__init__.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/modulenamer.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/codegenerator/namespaces.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/tlbparser.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/tools/typedesc_base.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes/util.py +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes.egg-info/dependency_links.txt +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes.egg-info/entry_points.txt +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/comtypes.egg-info/top_level.txt +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/setup.cfg +0 -0
- {comtypes-1.4.8 → comtypes-1.4.9}/setup.py +0 -0
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
from comtypes._memberspec import _ComMemberSpec, _DispMemberSpec, _resolve_argspec
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class helpstring(str):
|
|
5
|
-
"Specifies the helpstring for a COM method or property."
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class defaultvalue(object):
|
|
9
|
-
"Specifies the default value for parameters marked optional."
|
|
10
|
-
|
|
11
|
-
def __init__(self, value):
|
|
12
|
-
self.value = value
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class dispid(int):
|
|
16
|
-
"Specifies the DISPID of a method or property."
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# XXX STDMETHOD, COMMETHOD, DISPMETHOD, and DISPPROPERTY should return
|
|
20
|
-
# instances with more methods or properties, and should not behave as an unpackable.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def STDMETHOD(restype, name, argtypes=()) -> _ComMemberSpec:
|
|
24
|
-
"Specifies a COM method slot without idlflags"
|
|
25
|
-
return _ComMemberSpec(restype, name, argtypes, None, (), None)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def DISPMETHOD(idlflags, restype, name, *argspec) -> _DispMemberSpec:
|
|
29
|
-
"Specifies a method of a dispinterface"
|
|
30
|
-
return _DispMemberSpec("DISPMETHOD", name, tuple(idlflags), restype, argspec)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def DISPPROPERTY(idlflags, proptype, name) -> _DispMemberSpec:
|
|
34
|
-
"Specifies a property of a dispinterface"
|
|
35
|
-
return _DispMemberSpec("DISPPROPERTY", name, tuple(idlflags), proptype, ())
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# tuple(idlflags) is for the method itself: (dispid, 'readonly')
|
|
39
|
-
|
|
40
|
-
# sample generated code:
|
|
41
|
-
# DISPPROPERTY([5, 'readonly'], OLE_YSIZE_HIMETRIC, 'Height'),
|
|
42
|
-
# DISPMETHOD(
|
|
43
|
-
# [6], None, 'Render', ([], c_int, 'hdc'), ([], c_int, 'x'), ([], c_int, 'y')
|
|
44
|
-
# )
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def COMMETHOD(idlflags, restype, methodname, *argspec) -> _ComMemberSpec:
|
|
48
|
-
"""Specifies a COM method slot with idlflags.
|
|
49
|
-
|
|
50
|
-
XXX should explain the sematics of the arguments.
|
|
51
|
-
"""
|
|
52
|
-
# collect all helpstring instances
|
|
53
|
-
# We should suppress docstrings when Python is started with -OO
|
|
54
|
-
# join them together(does this make sense?) and replace by None if empty.
|
|
55
|
-
helptext = "".join(t for t in idlflags if isinstance(t, helpstring)) or None
|
|
56
|
-
paramflags, argtypes = _resolve_argspec(argspec)
|
|
57
|
-
if "propget" in idlflags:
|
|
58
|
-
name = "_get_%s" % methodname
|
|
59
|
-
elif "propput" in idlflags:
|
|
60
|
-
name = "_set_%s" % methodname
|
|
61
|
-
elif "propputref" in idlflags:
|
|
62
|
-
name = "_setref_%s" % methodname
|
|
63
|
-
else:
|
|
64
|
-
name = methodname
|
|
65
|
-
return _ComMemberSpec(
|
|
66
|
-
restype, name, argtypes, paramflags, tuple(idlflags), helptext
|
|
67
|
-
)
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import comtypes.client, ctypes
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
################################################################
|
|
5
|
-
# Interfaces
|
|
6
|
-
class IClassFactory(comtypes.IUnknown):
|
|
7
|
-
_iid_ = comtypes.GUID("{00000001-0000-0000-C000-000000000046}")
|
|
8
|
-
_methods_ = [
|
|
9
|
-
comtypes.STDMETHOD(
|
|
10
|
-
comtypes.HRESULT,
|
|
11
|
-
"CreateInstance",
|
|
12
|
-
[
|
|
13
|
-
ctypes.POINTER(comtypes.IUnknown),
|
|
14
|
-
ctypes.POINTER(comtypes.GUID),
|
|
15
|
-
ctypes.POINTER(ctypes.c_void_p),
|
|
16
|
-
],
|
|
17
|
-
),
|
|
18
|
-
comtypes.STDMETHOD(comtypes.HRESULT, "LockServer", [ctypes.c_int]),
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
def CreateInstance(self, punkouter=None, interface=None, dynamic=False):
|
|
22
|
-
if dynamic:
|
|
23
|
-
if interface is not None:
|
|
24
|
-
raise ValueError("interface and dynamic are mutually exclusive")
|
|
25
|
-
realInterface = comtypes.automation.IDispatch
|
|
26
|
-
elif interface is None:
|
|
27
|
-
realInterface = comtypes.IUnknown
|
|
28
|
-
else:
|
|
29
|
-
realInterface = interface
|
|
30
|
-
obj = ctypes.POINTER(realInterface)()
|
|
31
|
-
self.__com_CreateInstance(punkouter, realInterface._iid_, ctypes.byref(obj))
|
|
32
|
-
if dynamic:
|
|
33
|
-
return comtypes.client.dynamic.Dispatch(obj)
|
|
34
|
-
elif interface is None:
|
|
35
|
-
# An interface was not specified, so return the best.
|
|
36
|
-
return comtypes.client.GetBestInterface(obj)
|
|
37
|
-
# An interface was specified and obj is already that interface.
|
|
38
|
-
return obj
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
# class IExternalConnection(IUnknown):
|
|
42
|
-
# _iid_ = GUID("{00000019-0000-0000-C000-000000000046}")
|
|
43
|
-
# _methods_ = [
|
|
44
|
-
# STDMETHOD(HRESULT, "AddConnection", [c_ulong, c_ulong]),
|
|
45
|
-
# STDMETHOD(HRESULT, "ReleaseConnection", [c_ulong, c_ulong, c_ulong])]
|
|
46
|
-
|
|
47
|
-
# The following code is untested:
|
|
48
|
-
|
|
49
|
-
ACTIVEOBJECT_STRONG = 0x0
|
|
50
|
-
ACTIVEOBJECT_WEAK = 0x1
|
|
51
|
-
|
|
52
|
-
oleaut32 = ctypes.oledll.oleaut32
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def RegisterActiveObject(comobj, weak=True):
|
|
56
|
-
punk = comobj._com_pointers_[comtypes.IUnknown._iid_]
|
|
57
|
-
clsid = comobj._reg_clsid_
|
|
58
|
-
if weak:
|
|
59
|
-
flags = ACTIVEOBJECT_WEAK
|
|
60
|
-
else:
|
|
61
|
-
flags = ACTIVEOBJECT_STRONG
|
|
62
|
-
handle = ctypes.c_ulong()
|
|
63
|
-
oleaut32.RegisterActiveObject(
|
|
64
|
-
punk, ctypes.byref(clsid), flags, ctypes.byref(handle)
|
|
65
|
-
)
|
|
66
|
-
return handle.value
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
def RevokeActiveObject(handle):
|
|
70
|
-
oleaut32.RevokeActiveObject(handle, None)
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
class GetoptError(Exception):
|
|
2
|
-
pass
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def w_getopt(args, options):
|
|
6
|
-
"""A getopt for Windows.
|
|
7
|
-
|
|
8
|
-
Options may start with either '-' or '/', the option names may
|
|
9
|
-
have more than one letter (/tlb or -RegServer), and option names
|
|
10
|
-
are case insensitive.
|
|
11
|
-
|
|
12
|
-
Returns two elements, just as getopt.getopt. The first is a list
|
|
13
|
-
of (option, value) pairs in the same way getopt.getopt does, but
|
|
14
|
-
there is no '-' or '/' prefix to the option name, and the option
|
|
15
|
-
name is always lower case. The second is the list of arguments
|
|
16
|
-
which do not belong to an option.
|
|
17
|
-
|
|
18
|
-
Different from getopt.getopt, a single argument not belonging to an option
|
|
19
|
-
does not terminate parsing.
|
|
20
|
-
"""
|
|
21
|
-
opts = []
|
|
22
|
-
arguments = []
|
|
23
|
-
while args:
|
|
24
|
-
if args[0][:1] in "/-":
|
|
25
|
-
arg = args[0][1:] # strip the '-' or '/'
|
|
26
|
-
arg = arg.lower()
|
|
27
|
-
|
|
28
|
-
if arg + ":" in options:
|
|
29
|
-
try:
|
|
30
|
-
opts.append((arg, args[1]))
|
|
31
|
-
except IndexError:
|
|
32
|
-
raise GetoptError("option '%s' requires an argument" % args[0])
|
|
33
|
-
args = args[1:]
|
|
34
|
-
elif arg in options:
|
|
35
|
-
opts.append((arg, ""))
|
|
36
|
-
else:
|
|
37
|
-
raise GetoptError("invalid option '%s'" % args[0])
|
|
38
|
-
args = args[1:]
|
|
39
|
-
else:
|
|
40
|
-
arguments.append(args[0])
|
|
41
|
-
args = args[1:]
|
|
42
|
-
|
|
43
|
-
return opts, arguments
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if __debug__:
|
|
47
|
-
if __name__ == "__main__":
|
|
48
|
-
import unittest
|
|
49
|
-
|
|
50
|
-
class TestCase(unittest.TestCase):
|
|
51
|
-
def test_1(self):
|
|
52
|
-
args = "-embedding spam /RegServer foo /UnregSERVER blabla".split()
|
|
53
|
-
opts, args = w_getopt(args, "regserver unregserver embedding".split())
|
|
54
|
-
self.assertEqual(
|
|
55
|
-
opts, [("embedding", ""), ("regserver", ""), ("unregserver", "")]
|
|
56
|
-
)
|
|
57
|
-
self.assertEqual(args, ["spam", "foo", "blabla"])
|
|
58
|
-
|
|
59
|
-
def test_2(self):
|
|
60
|
-
args = "/TLB Hello.Tlb HELLO.idl".split()
|
|
61
|
-
opts, args = w_getopt(args, ["tlb:"])
|
|
62
|
-
self.assertEqual(opts, [("tlb", "Hello.Tlb")])
|
|
63
|
-
self.assertEqual(args, ["HELLO.idl"])
|
|
64
|
-
|
|
65
|
-
def test_3(self):
|
|
66
|
-
# Invalid option
|
|
67
|
-
self.assertRaises(
|
|
68
|
-
GetoptError, w_getopt, "/TLIB hello.tlb hello.idl".split(), ["tlb:"]
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
def test_4(self):
|
|
72
|
-
# Missing argument
|
|
73
|
-
self.assertRaises(GetoptError, w_getopt, "/TLB".split(), ["tlb:"])
|
|
74
|
-
|
|
75
|
-
unittest.main()
|
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import unittest
|
|
3
|
-
|
|
4
|
-
import comtypes.test.TestComServer
|
|
5
|
-
from comtypes.client import CreateObject
|
|
6
|
-
from comtypes.server.register import register # , unregister
|
|
7
|
-
from comtypes.test import is_resource_enabled
|
|
8
|
-
from comtypes.test.find_memleak import find_memleak
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def setUpModule():
|
|
12
|
-
raise unittest.SkipTest(
|
|
13
|
-
"This test requires the tests to be run as admin since it tries to "
|
|
14
|
-
"register the test COM server. Is this a good idea?"
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
# If this test is ever NOT skipped, then this line needs to run. Keeping it here for posterity.
|
|
18
|
-
register(comtypes.test.TestComServer.TestComServer)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class TestInproc(unittest.TestCase):
|
|
22
|
-
def create_object(self):
|
|
23
|
-
return CreateObject(
|
|
24
|
-
"TestComServerLib.TestComServer", clsctx=comtypes.CLSCTX_INPROC_SERVER
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
def _find_memleak(self, func):
|
|
28
|
-
bytes = find_memleak(func)
|
|
29
|
-
self.assertFalse(bytes, "Leaks %d bytes" % bytes)
|
|
30
|
-
|
|
31
|
-
def test_mixedinout(self):
|
|
32
|
-
o = self.create_object()
|
|
33
|
-
self.assertEqual(o.MixedInOut(2, 4), (3, 5))
|
|
34
|
-
|
|
35
|
-
def test_getname(self):
|
|
36
|
-
from ctypes import pointer
|
|
37
|
-
from comtypes import BSTR
|
|
38
|
-
|
|
39
|
-
# This tests a tricky bug, introduced with this patch:
|
|
40
|
-
# http://www.python.org/sf/1643874
|
|
41
|
-
#
|
|
42
|
-
# Returning a BSTR as an [out] parameter from a server
|
|
43
|
-
# implementation must transfer the ownership to the caller.
|
|
44
|
-
# When this is not done, the BSTR instance is SysFreeString'd
|
|
45
|
-
# too early, and the memory is reused.
|
|
46
|
-
obj = self.create_object()
|
|
47
|
-
pb = pointer(BSTR())
|
|
48
|
-
# Get the BSTR from the server:
|
|
49
|
-
obj._ITestComServer__com__get_name(pb)
|
|
50
|
-
# Retrieve the value, but keep the pointer to the BSTR alive:
|
|
51
|
-
name = pb[0]
|
|
52
|
-
# Create sme BSTR's to reuse the memory in case it has been freed:
|
|
53
|
-
for i in range(10):
|
|
54
|
-
BSTR("f" * len(name))
|
|
55
|
-
# Make sure the pointer is still valid:
|
|
56
|
-
self.assertEqual(pb[0], name)
|
|
57
|
-
|
|
58
|
-
if is_resource_enabled("memleaks"):
|
|
59
|
-
|
|
60
|
-
def test_get_id(self):
|
|
61
|
-
obj = self.create_object()
|
|
62
|
-
self._find_memleak(lambda: obj.id)
|
|
63
|
-
|
|
64
|
-
def test_get_name(self):
|
|
65
|
-
obj = self.create_object()
|
|
66
|
-
self._find_memleak(lambda: obj.name)
|
|
67
|
-
|
|
68
|
-
def test_set_name(self):
|
|
69
|
-
obj = self.create_object()
|
|
70
|
-
|
|
71
|
-
def func():
|
|
72
|
-
obj.name = "abcde"
|
|
73
|
-
|
|
74
|
-
self._find_memleak(func)
|
|
75
|
-
|
|
76
|
-
def test_SetName(self):
|
|
77
|
-
obj = self.create_object()
|
|
78
|
-
|
|
79
|
-
def func():
|
|
80
|
-
obj.SetName("abcde")
|
|
81
|
-
|
|
82
|
-
self._find_memleak(func)
|
|
83
|
-
|
|
84
|
-
def test_eval(self):
|
|
85
|
-
obj = self.create_object()
|
|
86
|
-
|
|
87
|
-
def func():
|
|
88
|
-
return obj.eval("(1, 2, 3)")
|
|
89
|
-
|
|
90
|
-
self.assertEqual(func(), (1, 2, 3))
|
|
91
|
-
self._find_memleak(func)
|
|
92
|
-
|
|
93
|
-
def test_get_typeinfo(self):
|
|
94
|
-
obj = self.create_object()
|
|
95
|
-
|
|
96
|
-
def func():
|
|
97
|
-
obj.GetTypeInfo(0)
|
|
98
|
-
obj.GetTypeInfoCount()
|
|
99
|
-
obj.QueryInterface(comtypes.IUnknown)
|
|
100
|
-
|
|
101
|
-
self._find_memleak(func)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if is_resource_enabled("ui"):
|
|
105
|
-
|
|
106
|
-
class TestLocalServer(TestInproc):
|
|
107
|
-
def create_object(self):
|
|
108
|
-
return CreateObject(
|
|
109
|
-
"TestComServerLib.TestComServer", clsctx=comtypes.CLSCTX_LOCAL_SERVER
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
try:
|
|
114
|
-
from win32com.client import Dispatch
|
|
115
|
-
except ImportError:
|
|
116
|
-
pass
|
|
117
|
-
else:
|
|
118
|
-
|
|
119
|
-
class TestInproc_win32com(TestInproc):
|
|
120
|
-
def create_object(self):
|
|
121
|
-
return Dispatch("TestComServerLib.TestComServer")
|
|
122
|
-
|
|
123
|
-
# These tests make no sense with win32com, override to disable them:
|
|
124
|
-
def test_get_typeinfo(self):
|
|
125
|
-
pass
|
|
126
|
-
|
|
127
|
-
def test_getname(self):
|
|
128
|
-
pass
|
|
129
|
-
|
|
130
|
-
def test_mixedinout(self):
|
|
131
|
-
# Not sure about this; it raise 'Invalid Number of parameters'
|
|
132
|
-
# Is mixed [in], [out] args not compatible with IDispatch???
|
|
133
|
-
pass
|
|
134
|
-
|
|
135
|
-
if is_resource_enabled("ui"):
|
|
136
|
-
|
|
137
|
-
class TestLocalServer_win32com(TestInproc_win32com):
|
|
138
|
-
def create_object(self):
|
|
139
|
-
return Dispatch(
|
|
140
|
-
"TestComServerLib.TestComServer",
|
|
141
|
-
clsctx=comtypes.CLSCTX_LOCAL_SERVER,
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
import doctest
|
|
146
|
-
import comtypes.test.test_comserver
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
class TestCase(unittest.TestCase):
|
|
150
|
-
def test(self):
|
|
151
|
-
doctest.testmod(comtypes.test.test_comserver, optionflags=doctest.ELLIPSIS)
|
|
152
|
-
|
|
153
|
-
# The following functions are never called, they only contain doctests:
|
|
154
|
-
|
|
155
|
-
if sys.version_info >= (3, 0):
|
|
156
|
-
|
|
157
|
-
def ShowEvents(self):
|
|
158
|
-
"""
|
|
159
|
-
>>> from comtypes.client import CreateObject, ShowEvents
|
|
160
|
-
>>>
|
|
161
|
-
>>> o = CreateObject("TestComServerLib.TestComServer")
|
|
162
|
-
>>> con = ShowEvents(o)
|
|
163
|
-
# event found: ITestComServerEvents_EvalStarted
|
|
164
|
-
# event found: ITestComServerEvents_EvalCompleted
|
|
165
|
-
>>> result = o.eval("10. / 4")
|
|
166
|
-
Event ITestComServerEvents_EvalStarted(None, '10. / 4')
|
|
167
|
-
Event ITestComServerEvents_EvalCompleted(None, '10. / 4', VARIANT(vt=0x5, 2.5))
|
|
168
|
-
>>> result
|
|
169
|
-
2.5
|
|
170
|
-
>>>
|
|
171
|
-
"""
|
|
172
|
-
|
|
173
|
-
else:
|
|
174
|
-
|
|
175
|
-
def ShowEvents(self):
|
|
176
|
-
"""
|
|
177
|
-
>>> from comtypes.client import CreateObject, ShowEvents
|
|
178
|
-
>>>
|
|
179
|
-
>>> o = CreateObject("TestComServerLib.TestComServer")
|
|
180
|
-
>>> con = ShowEvents(o)
|
|
181
|
-
# event found: ITestComServerEvents_EvalStarted
|
|
182
|
-
# event found: ITestComServerEvents_EvalCompleted
|
|
183
|
-
>>> result = o.eval("10. / 4")
|
|
184
|
-
Event ITestComServerEvents_EvalStarted(None, u'10. / 4')
|
|
185
|
-
Event ITestComServerEvents_EvalCompleted(None, u'10. / 4', VARIANT(vt=0x5, 2.5))
|
|
186
|
-
>>> result
|
|
187
|
-
2.5
|
|
188
|
-
>>>
|
|
189
|
-
"""
|
|
190
|
-
|
|
191
|
-
# The following test, if enabled, works but the testsuit
|
|
192
|
-
# crashes elsewhere. Is there s problem with SAFEARRAYs?
|
|
193
|
-
|
|
194
|
-
if is_resource_enabled("CRASHES"):
|
|
195
|
-
|
|
196
|
-
def Fails(self):
|
|
197
|
-
"""
|
|
198
|
-
>>> from comtypes.client import CreateObject, ShowEvents
|
|
199
|
-
>>>
|
|
200
|
-
>>> o = CreateObject("TestComServerLib.TestComServer")
|
|
201
|
-
>>> con = ShowEvents(o)
|
|
202
|
-
# event found: ITestComServerEvents_EvalStarted
|
|
203
|
-
# event found: ITestComServerEvents_EvalCompleted
|
|
204
|
-
>>> result = o.eval("['32'] * 2")
|
|
205
|
-
Event ITestComServerEvents_EvalStarted(None, u"['32'] * 2")
|
|
206
|
-
Event ITestComServerEvents_EvalCompleted(None, u"['32'] * 2", VARIANT(vt=0x200c, (u'32', u'32')))
|
|
207
|
-
>>> result
|
|
208
|
-
(u'32', u'32')
|
|
209
|
-
>>>
|
|
210
|
-
"""
|
|
211
|
-
|
|
212
|
-
def GetEvents(self):
|
|
213
|
-
"""
|
|
214
|
-
>>> from comtypes.client import CreateObject, GetEvents
|
|
215
|
-
>>>
|
|
216
|
-
>>> o = CreateObject("TestComServerLib.TestComServer")
|
|
217
|
-
>>> class EventHandler(object):
|
|
218
|
-
... def EvalStarted(self, this, what):
|
|
219
|
-
... print("EvalStarted: %s" % what)
|
|
220
|
-
... return 0
|
|
221
|
-
... def EvalCompleted(self, this, what, result):
|
|
222
|
-
... print("EvalCompleted: %s = %s" % (what, result.value))
|
|
223
|
-
... return 0
|
|
224
|
-
...
|
|
225
|
-
>>>
|
|
226
|
-
>>> con = GetEvents(o, EventHandler())
|
|
227
|
-
>>> o.eval("2 + 3")
|
|
228
|
-
EvalStarted: 2 + 3
|
|
229
|
-
EvalCompleted: 2 + 3 = 5
|
|
230
|
-
5
|
|
231
|
-
>>> del con
|
|
232
|
-
>>> o.eval("3 + 2")
|
|
233
|
-
5
|
|
234
|
-
>>>
|
|
235
|
-
"""
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if __name__ == "__main__":
|
|
239
|
-
unittest.main()
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
|
|
3
|
-
import comtypes.test.TestDispServer
|
|
4
|
-
from comtypes.server.register import register # , unregister
|
|
5
|
-
from comtypes.test import is_resource_enabled
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def setUpModule():
|
|
9
|
-
raise unittest.SkipTest(
|
|
10
|
-
"This test requires the tests to be run as admin since it tries to "
|
|
11
|
-
"register the test COM server. Is this a good idea?"
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
# If this test is ever NOT skipped, then this line needs to run. Keeping it here for posterity.
|
|
15
|
-
register(comtypes.test.TestDispServer.TestDispServer)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class Test(unittest.TestCase):
|
|
19
|
-
if is_resource_enabled("pythoncom"):
|
|
20
|
-
|
|
21
|
-
def test_win32com(self):
|
|
22
|
-
# EnsureDispatch is case-sensitive
|
|
23
|
-
from win32com.client.gencache import EnsureDispatch
|
|
24
|
-
|
|
25
|
-
d = EnsureDispatch("TestDispServerLib.TestDispServer")
|
|
26
|
-
|
|
27
|
-
self.assertEqual(d.eval("3.14"), 3.14)
|
|
28
|
-
self.assertEqual(d.eval("1 + 2"), 3)
|
|
29
|
-
self.assertEqual(d.eval("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
30
|
-
|
|
31
|
-
self.assertEqual(d.eval2("3.14"), 3.14)
|
|
32
|
-
self.assertEqual(d.eval2("1 + 2"), 3)
|
|
33
|
-
self.assertEqual(d.eval2("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
34
|
-
|
|
35
|
-
d.eval(
|
|
36
|
-
"__import__('comtypes.client').client.CreateObject('Scripting.Dictionary')"
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
server_id = d.eval("id(self)")
|
|
40
|
-
self.assertEqual(d.id, server_id)
|
|
41
|
-
|
|
42
|
-
self.assertEqual(d.name, "spam, spam, spam")
|
|
43
|
-
|
|
44
|
-
d.SetName("foo bar")
|
|
45
|
-
self.assertEqual(d.name, "foo bar")
|
|
46
|
-
|
|
47
|
-
d.name = "blah"
|
|
48
|
-
self.assertEqual(d.name, "blah")
|
|
49
|
-
|
|
50
|
-
def test_win32com_dyndispatch(self):
|
|
51
|
-
# dynamic Dispatch is case-IN-sensitive
|
|
52
|
-
from win32com.client.dynamic import Dispatch
|
|
53
|
-
|
|
54
|
-
d = Dispatch("TestDispServerLib.TestDispServer")
|
|
55
|
-
|
|
56
|
-
self.assertEqual(d.eval("3.14"), 3.14)
|
|
57
|
-
self.assertEqual(d.eval("1 + 2"), 3)
|
|
58
|
-
self.assertEqual(d.eval("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
59
|
-
|
|
60
|
-
self.assertEqual(d.eval2("3.14"), 3.14)
|
|
61
|
-
self.assertEqual(d.eval2("1 + 2"), 3)
|
|
62
|
-
self.assertEqual(d.eval2("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
63
|
-
|
|
64
|
-
d.eval(
|
|
65
|
-
"__import__('comtypes.client').client.CreateObject('Scripting.Dictionary')"
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
self.assertEqual(d.EVAL("3.14"), 3.14)
|
|
69
|
-
self.assertEqual(d.EVAL("1 + 2"), 3)
|
|
70
|
-
self.assertEqual(d.EVAL("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
71
|
-
|
|
72
|
-
self.assertEqual(d.EVAL2("3.14"), 3.14)
|
|
73
|
-
self.assertEqual(d.EVAL2("1 + 2"), 3)
|
|
74
|
-
self.assertEqual(d.EVAL2("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
75
|
-
|
|
76
|
-
server_id = d.eval("id(self)")
|
|
77
|
-
self.assertEqual(d.id, server_id)
|
|
78
|
-
self.assertEqual(d.ID, server_id)
|
|
79
|
-
|
|
80
|
-
self.assertEqual(d.Name, "spam, spam, spam")
|
|
81
|
-
self.assertEqual(d.nAME, "spam, spam, spam")
|
|
82
|
-
|
|
83
|
-
d.SetName("foo bar")
|
|
84
|
-
self.assertEqual(d.Name, "foo bar")
|
|
85
|
-
|
|
86
|
-
# fails. Why?
|
|
87
|
-
# d.name = "blah"
|
|
88
|
-
# self.assertEqual(d.Name, "blah")
|
|
89
|
-
|
|
90
|
-
def test_comtypes(self):
|
|
91
|
-
from comtypes.client import CreateObject
|
|
92
|
-
|
|
93
|
-
d = CreateObject("TestDispServerLib.TestDispServer")
|
|
94
|
-
|
|
95
|
-
self.assertEqual(d.eval("3.14"), 3.14)
|
|
96
|
-
self.assertEqual(d.eval("1 + 2"), 3)
|
|
97
|
-
self.assertEqual(d.eval("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
98
|
-
|
|
99
|
-
self.assertEqual(d.eval2("3.14"), 3.14)
|
|
100
|
-
self.assertEqual(d.eval2("1 + 2"), 3)
|
|
101
|
-
self.assertEqual(d.eval2("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
102
|
-
|
|
103
|
-
d.eval(
|
|
104
|
-
"__import__('comtypes.client').client.CreateObject('Scripting.Dictionary')"
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
self.assertEqual(d.EVAL("3.14"), 3.14)
|
|
108
|
-
self.assertEqual(d.EVAL("1 + 2"), 3)
|
|
109
|
-
self.assertEqual(d.EVAL("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
110
|
-
|
|
111
|
-
self.assertEqual(d.EVAL2("3.14"), 3.14)
|
|
112
|
-
self.assertEqual(d.EVAL2("1 + 2"), 3)
|
|
113
|
-
self.assertEqual(d.EVAL2("[1 + 2, 'foo', None]"), (3, "foo", None))
|
|
114
|
-
|
|
115
|
-
server_id = d.eval("id(self)")
|
|
116
|
-
self.assertEqual(d.id, server_id)
|
|
117
|
-
self.assertEqual(d.ID, server_id)
|
|
118
|
-
|
|
119
|
-
self.assertEqual(d.Name, "spam, spam, spam")
|
|
120
|
-
self.assertEqual(d.nAME, "spam, spam, spam")
|
|
121
|
-
|
|
122
|
-
d.SetName("foo bar")
|
|
123
|
-
self.assertEqual(d.Name, "foo bar")
|
|
124
|
-
|
|
125
|
-
d.name = "blah"
|
|
126
|
-
self.assertEqual(d.Name, "blah")
|
|
127
|
-
|
|
128
|
-
def test_withjscript(self):
|
|
129
|
-
import os
|
|
130
|
-
|
|
131
|
-
jscript = os.path.join(os.path.dirname(__file__), "test_jscript.js")
|
|
132
|
-
errcode = os.system("cscript -nologo %s" % jscript)
|
|
133
|
-
self.assertEqual(errcode, 0)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if __name__ == "__main__":
|
|
137
|
-
unittest.main()
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# There are also propputref tests in test_sapi.py!
|
|
2
|
-
import unittest
|
|
3
|
-
from comtypes.client import CreateObject
|
|
4
|
-
from comtypes.automation import VARIANT
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class Test(unittest.TestCase):
|
|
8
|
-
@unittest.skip(
|
|
9
|
-
"Fails on creating `TestComServerLib.TestComServer`. Figure out why."
|
|
10
|
-
)
|
|
11
|
-
def test(self, dynamic=False):
|
|
12
|
-
d = CreateObject("Scripting.Dictionary", dynamic=dynamic)
|
|
13
|
-
s = CreateObject("TestComServerLib.TestComServer", dynamic=dynamic)
|
|
14
|
-
s.name = "the value"
|
|
15
|
-
|
|
16
|
-
# This calls propputref, since we assign an Object
|
|
17
|
-
d.Item["object"] = s
|
|
18
|
-
# This calls propput, since we assing a Value
|
|
19
|
-
d.Item["value"] = s.name
|
|
20
|
-
|
|
21
|
-
self.assertEqual(d.Item["object"], s)
|
|
22
|
-
self.assertEqual(d.Item["object"].name, "the value")
|
|
23
|
-
self.assertEqual(d.Item["value"], "the value")
|
|
24
|
-
|
|
25
|
-
# Changing the default property of the object
|
|
26
|
-
s.name = "foo bar"
|
|
27
|
-
self.assertEqual(d.Item["object"], s)
|
|
28
|
-
self.assertEqual(d.Item["object"].name, "foo bar")
|
|
29
|
-
self.assertEqual(d.Item["value"], "the value")
|
|
30
|
-
|
|
31
|
-
# This also calls propputref since we assign an Object
|
|
32
|
-
d.Item["var"] = VARIANT(s)
|
|
33
|
-
self.assertEqual(d.Item["var"], s)
|
|
34
|
-
|
|
35
|
-
def test_dispatch(self):
|
|
36
|
-
return self.test(dynamic=True)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if __name__ == "__main__":
|
|
40
|
-
unittest.main()
|