

def test_query_interface(self):
    d = self.d
    d.CompareMode = 42
    d.Item['foo'] = 1
    d.Item['bar'] = 'spam foo'
    d.Item['baz'] = 3.14
    d2 = d.QueryInterface(IDispatch)
    d3 = d2.QueryInterface(IDictionary)
    self.assertEqual(d3.CompareMode, 42)
    self.assertEqual(d3.Item['foo'], 1)
    self.assertEqual(d3.Item['bar'], 'spam foo')
    self.assertEqual(d3.Item['baz'], 3.14)

dataset/ETHPy150Open enthought/comtypes/comtypes/test/test_dyndispatch.py Test.test_query_interface/original