Merge lp:~nataliabidart/ubuntuone-windows-installer/run-test-in-linux into lp:ubuntuone-windows-installer

Proposed by Natalia Bidart
Status: Merged
Approved by: Roberto Alsina
Approved revision: 20
Merged at revision: 19
Proposed branch: lp:~nataliabidart/ubuntuone-windows-installer/run-test-in-linux
Merge into: lp:ubuntuone-windows-installer
Diff against target: 145 lines (+29/-14)
3 files modified
run-tests (+2/-2)
setup.py (+16/-7)
ubuntuone_installer/gui/qt/local_folders.py (+11/-5)
To merge this branch: bzr merge lp:~nataliabidart/ubuntuone-windows-installer/run-test-in-linux
Reviewer Review Type Date Requested Status
Roberto Alsina (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+68310@code.launchpad.net

Commit message

- Tests now pass in Linux!

Description of the change

To run the tests, you need to build the SSO project, and to do so you need to use the following branch:

lp:~nataliabidart/ubuntu-sso-client/build-on-linux

Then, you need to point PYTHONPATH to that branch and controlpanel's trunk, and run the suite:

PYTHONPATH=../../../ussoc/build-on-linux/:../../controlpanel/trunk/:. ./run-tests

To post a comment you must log in.
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Roberto Alsina (ralsina) wrote :

They do!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests'
2--- run-tests 2011-06-22 12:40:19 +0000
3+++ run-tests 2011-07-19 00:44:34 +0000
4@@ -27,9 +27,9 @@
5 fi
6
7 style_check() {
8- pylint --ignore ui ubuntuone_installer/
9+ u1lint --ignore ubuntuone_installer/gui/qt/ui
10 if [ -x `which pep8` ]; then
11- pep8 --exclude '.svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py' --repeat bin/ $MODULE
12+ pep8 --exclude '.svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py' --repeat .
13 else
14 echo "Please install the 'pep8' package."
15 fi
16
17=== modified file 'setup.py'
18--- setup.py 2011-06-21 16:36:01 +0000
19+++ setup.py 2011-07-19 00:44:34 +0000
20@@ -20,9 +20,10 @@
21 # with this program. If not, see <http://www.gnu.org/licenses/>.
22 """Setup.py: build, distribute, clean."""
23
24+# pylint: disable=W0404
25+
26 import os
27 import sys
28-import cgi
29
30 try:
31 import DistUtilsExtra.auto
32@@ -43,6 +44,7 @@
33 CLEANFILES = [
34 MESSAGE_ENTRY, CONSTANTS, POT_FILE,
35 'MANIFEST']
36+QT_UI_DIR = os.path.join('ubuntuone_installer', 'gui', 'qt', 'ui')
37
38
39 def replace_prefix(prefix):
40@@ -61,7 +63,7 @@
41 def run(self):
42 """Do the install.
43
44- Read from *.service.in and generate .service files with reeplacing
45+ Read from *.service.in and generate .service files by replacing
46 @prefix@ by self.prefix.
47
48 """
49@@ -72,7 +74,6 @@
50 class InstallerBuild(build_extra.build_extra):
51 """Build PyQt (.ui) files and resources."""
52
53- QT_UI_DIR = os.path.join('ubuntuone_installer', 'gui', 'qt', 'ui')
54 description = "build PyQt GUIs (.ui) and resources (.qrc)"
55
56 def compile_ui(self, ui_file, py_file=None):
57@@ -83,7 +84,7 @@
58 # python file in the qt moodule
59 py_file = os.path.split(ui_file)[1]
60 py_file = os.path.splitext(py_file)[0] + '_ui.py'
61- py_file = os.path.join(self.QT_UI_DIR, py_file)
62+ py_file = os.path.join(QT_UI_DIR, py_file)
63 # we indeed want to catch Exception, is ugly but we need it
64 # pylint: disable=W0703
65 try:
66@@ -109,13 +110,14 @@
67 if py_file is None:
68 py_file = os.path.split(qrc_file)[1]
69 py_file = os.path.splitext(py_file)[0] + '_rc.py'
70- py_file = os.path.join(self.QT_UI_DIR, py_file)
71+ py_file = os.path.join(QT_UI_DIR, py_file)
72 path = os.getenv('PATH')
73 os.putenv('PATH', path + os.path.pathsep + os.path.join(
74 os.path.dirname(PyQt4.__file__), 'bin'))
75 if os.system('pyrcc4 "%s" -o "%s"' % (qrc_file, py_file)) > 0:
76- self.warn('Unable to generate python module %s '
77- + 'for resource file %s', py_file, qrc_file)
78+ self.warn('Unable to generate python module {py_file}'
79+ ' for resource file {qrc_file}'.format(
80+ py_file=py_file, qrc_file=qrc_file))
81 if not os.path.exists(py_file) or not file(py_file).read():
82 raise SystemExit(1)
83 else:
84@@ -128,6 +130,7 @@
85 f = open(qrc_file, 'w')
86 try:
87 f.write('<!DOCTYPE RCC><RCC version="1.0">\n')
88+ import cgi
89 f.write(' <qresource prefix="%s">\n' % cgi.escape(prefix))
90 for e in srcfiles:
91 relpath = e[len(basedir) + 1:]
92@@ -213,6 +216,12 @@
93 if os.path.exists(built_file):
94 os.unlink(built_file)
95
96+ for dirpath, _, filenames in os.walk(os.path.join(QT_UI_DIR)):
97+ for current_file in filenames:
98+ if current_file.endswith('_ui.py') or\
99+ current_file.endswith('_rc.py'):
100+ os.unlink(os.path.join(dirpath, current_file))
101+
102 DistUtilsExtra.auto.clean_build_tree.run(self)
103
104
105
106=== modified file 'ubuntuone_installer/gui/qt/local_folders.py'
107--- ubuntuone_installer/gui/qt/local_folders.py 2011-07-07 20:32:17 +0000
108+++ ubuntuone_installer/gui/qt/local_folders.py 2011-07-19 00:44:34 +0000
109@@ -20,6 +20,7 @@
110
111 import ctypes
112 import os
113+import sys
114 import threading
115 import Queue
116
117@@ -66,6 +67,7 @@
118
119 class LocalFoldersPage(QtGui.QWizardPage):
120 """Wizard page to create UDFs in the Windows Installer."""
121+
122 def __init__(self, parent=None):
123 super(LocalFoldersPage, self).__init__(parent)
124 self.setTitle(LOCAL_FOLDERS_TITLE)
125@@ -97,11 +99,15 @@
126
127 def default_folders(self):
128 """Return a list of the folders to add by default."""
129- # Special Folder "My Documents"
130- dll = ctypes.windll.shell32
131- buf = ctypes.create_string_buffer(300)
132- dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False)
133- return [buf.value, ]
134+ if sys.platform == 'win32':
135+ # Special Folder "My Documents"
136+ dll = ctypes.windll.shell32
137+ buf = ctypes.create_string_buffer(300)
138+ dll.SHGetSpecialFolderPathA(None, buf, 0x0005, False)
139+ result = [buf.value, ]
140+ else:
141+ result = ['To be implemented']
142+ return result
143
144 def add_folder(self, path):
145 """Add a folder to the list."""

Subscribers

People subscribed via source and target branches