on xenial help sign in
Give default value to gu-px size

Fixes some of the autopilot greeter tests when run under X11

commit8a74c4367cfa2301066dd891e417fa0c61789f33 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 25 Oct 2016, 15:11 (10 years ago) parent1999d6f
1 file changed+4−1
tests/autopilot/unity8/shell/tests/__init__.py+4−1
tests/autopilot/unity8/shell/tests/__init__.py+4−1
@@ -156,7 +156,10 @@ class UnityTestCase(AutopilotTestCase):
156156 def _setup_grid_size(self, scale_divisor):
157157 """Use the grid size that may be supplied or use the default."""
158158 if getattr(self, 'grid_unit_px', 0) == 0:
159− self.grid_size = int(os.getenv('GRID_UNIT_PX'))
159+ if os.getenv('GRID_UNIT_PX') == None:
160+ self.grid_size = 8
161+ else:
162+ self.grid_size = int(os.getenv('GRID_UNIT_PX'))
160163 else:
161164 self.grid_size = int(self.grid_unit_px / scale_divisor)
162165 self._environment["GRID_UNIT_PX"] = str(self.grid_size)