Martin (gzlist) schrieb: > Attached is a patch that adds the IShellLinkDataList interface to > comtypes.shelllink and a couple of structures that can be used to > change the settings of the console when the link is targetting cmd. > > Run into some problem trying to create a > comtypes/test/test_shelllink.py to cover this. I wanted to do > something clever with subprocess, but: > > # Running a .lnk precludes piping output from the subprocess, so the > shortcut would have to record its own results. > # Even that's no good for testing the console data block additions, as > the settings of the cmd instance needed to run the .lnk override the > properties set on the shortcut. > > If there's a way to run the shortcut without going through cmd that > method might be okay. > > For the moment I wrote a few random tests that mostly just poke the > interfaces a bit and serve as a demonstration. > > Suggestions for improvements welcome.
Thanks for the patch, but I get these errors when I run the tests: F.FF.F ====================================================================== FAIL: test_basics (__main__.ShellLinkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "comtypes\test\test_shelllink.py", line 64, in test_basics self.assertEqual(sys.executable, shortcut.GetPath()) AssertionError: 'c:\\python25\\python.exe' != u'C:\\Python25\\python.exe' ====================================================================== FAIL: test_get_flags_args (__main__.ShellLinkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "comtypes\test\test_shelllink.py", line 108, in test_get_flags_args (SLDF_HAS_NAME | SLDF_HAS_RELPATH | SLDF_HAS_WORKINGDIR)) AssertionError: 0 != 8L ====================================================================== FAIL: test_get_flags_name (__main__.ShellLinkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "comtypes\test\test_shelllink.py", line 81, in test_get_flags_name (SLDF_HAS_RELPATH | SLDF_HAS_WORKINGDIR | SLDF_HAS_ARGS)) AssertionError: 0 != 8L ====================================================================== FAIL: test_get_flags_workingdir (__main__.ShellLinkTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "comtypes\test\test_shelllink.py", line 99, in test_get_flags_workingdir (SLDF_HAS_NAME | SLDF_HAS_RELPATH | SLDF_HAS_ARGS)) AssertionError: 0 != 8L ---------------------------------------------------------------------- Ran 6 tests in 0.141s FAILED (failures=4) The first failure is easy to fix (use case insensitive comparison), but I don't know about the others. -- Thanks, Thomas ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users