From c301c5115bf57c8e282911efa388658468f26f7f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 3 Nov 2011 06:36:25 +0000 Subject: [PATCH] Add impl for MSWGetShellDir and add unittest git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etg/stdpaths.py | 9 ++++++++- unittests/test_stdpaths.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 unittests/test_stdpaths.py diff --git a/etg/stdpaths.py b/etg/stdpaths.py index 89aba866..d81dbadd 100644 --- a/etg/stdpaths.py +++ b/etg/stdpaths.py @@ -34,7 +34,14 @@ def run(): c.find('IgnoreAppSubDir').ignore() c.find('DontIgnoreAppSubDir').ignore() c.find('IgnoreAppBuildSubDirs').ignore() - c.find('MSWGetShellDir').ignore() + + c.find('MSWGetShellDir').setCppCode("""\ + #ifdef __WXMSW__ + return new wxString(self->MSWGetShellDir(csidl)); + #else + return new wxString; + #endif + """) c.find('SetInstallPrefix').setCppCode("""\ #ifdef __WXMSW__ diff --git a/unittests/test_stdpaths.py b/unittests/test_stdpaths.py new file mode 100644 index 00000000..27f2574d --- /dev/null +++ b/unittests/test_stdpaths.py @@ -0,0 +1,34 @@ +import imp_unittest, unittest +import wtc +import wx +import os + + +#--------------------------------------------------------------------------- + +class stdpaths_Tests(wtc.WidgetTestCase): + + def test_stdpaths(self): + sp = wx.StandardPaths.Get() + sp.GetAppDocumentsDir() + sp.GetConfigDir() + sp.GetDataDir() + sp.GetDocumentsDir() + sp.GetExecutablePath() + sp.GetInstallPrefix() + sp.GetLocalDataDir() + sp.GetPluginsDir() + sp.GetResourcesDir() + sp.GetTempDir() + sp.GetUserConfigDir() + sp.GetUserDataDir() + sp.GetUserLocalDataDir() + sp.SetInstallPrefix('/opt/foo') + sp.GetLocalizedResourcesDir('fr') + + +#--------------------------------------------------------------------------- + + +if __name__ == '__main__': + unittest.main()