Exemplo n.º 1
0
    def _testPackUnpack(self, text):
        vals = dict(
            hitem=1,
            state=2,
            stateMask=3,
            text=text,
            image=4,
            selimage=5,
            citems=6,
            param=7,
        )

        ti, extra = win32gui_struct.PackTVITEM(**vals)
        (
            hitem,
            state,
            stateMask,
            text,
            image,
            selimage,
            citems,
            param,
        ) = win32gui_struct.UnpackTVITEM(ti)

        self.assertDictEquals(
            vals,
            hitem=hitem,
            state=state,
            stateMask=stateMask,
            text=text,
            image=image,
            selimage=selimage,
            citems=citems,
            param=param,
        )
Exemplo n.º 2
0
 def testEmpty(self):
     ti, extras = win32gui_struct.EmptyTVITEM(0)
     hitem, state, stateMask, text, image, selimage, citems, param = \
         win32gui_struct.UnpackTVITEM(ti)
     self.failUnlessEqual(hitem, 0)
     self.failUnlessEqual(state, 0)
     self.failUnlessEqual(stateMask, 0)
     self.failUnlessEqual(text, '')
     self.failUnlessEqual(image, 0)
     self.failUnlessEqual(selimage, 0)
     self.failUnlessEqual(citems, 0)
     self.failUnlessEqual(param, 0)
Exemplo n.º 3
0
 def testEmpty(self):
     ti, extras = win32gui_struct.EmptyTVITEM(0)
     hitem, state, stateMask, text, image, selimage, citems, param = \
         win32gui_struct.UnpackTVITEM(ti)
     assert hitem == 0
     assert state == 0
     assert stateMask == 0
     assert text == ''
     assert image == 0
     assert selimage == 0
     assert citems == 0
     assert param == 0
Exemplo n.º 4
0
 def testEmpty(self):
     ti, extras = win32gui_struct.EmptyTVITEM(0)
     (
         hitem,
         state,
         stateMask,
         text,
         image,
         selimage,
         citems,
         param,
     ) = win32gui_struct.UnpackTVITEM(ti)
     self.assertEqual(hitem, 0)
     self.assertEqual(state, 0)
     self.assertEqual(stateMask, 0)
     self.assertEqual(text, "")
     self.assertEqual(image, 0)
     self.assertEqual(selimage, 0)
     self.assertEqual(citems, 0)
     self.assertEqual(param, 0)