Advertisement
Guest User

Untitled

a guest
May 15th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. === modified file 'setup.py'
  2. --- setup.py 2012-04-10 12:10:55 +0000
  3. +++ setup.py 2012-05-15 23:25:47 +0000
  4. @@ -156,7 +156,8 @@
  5. 'zope.principalregistry',
  6. 'zope.testbrowser',
  7. 'schooltool.devtools>=0.6',
  8. - 'selenium'],
  9. + 'selenium',
  10. + 'pyvirtualdisplay'],
  11. 'docs': ['Sphinx',
  12. 'z3c.recipe.sphinxdoc'],
  13. 'apidoc': ['zope.app.apidoc'],
  14.  
  15. === modified file 'src/schooltool/testing/selenium.py'
  16. --- src/schooltool/testing/selenium.py 2012-03-26 14:57:09 +0000
  17. +++ src/schooltool/testing/selenium.py 2012-05-15 23:07:51 +0000
  18. @@ -33,6 +33,7 @@
  19. import unittest
  20. from StringIO import StringIO
  21. from UserDict import DictMixin
  22. +from pyvirtualdisplay import Display
  23.  
  24. import lxml.html
  25. import lxml.doctestcompare
  26. @@ -966,6 +967,7 @@
  27. def __init__(self, *args, **kw):
  28. ZCMLLayer.__init__(self, *args, **kw)
  29. self.browsers = BrowserPool(self)
  30. + self.display = Display(visible=False, size=(800, 600))
  31. if BLACK_MAGIC:
  32. self.patches = []
  33.  
  34. @@ -988,6 +990,7 @@
  35. self.thread.start()
  36. print 'serving at http://%s:%s/' % (
  37. self.server.socket.getsockname())
  38. + self.display.start()
  39.  
  40. def tearDown(self):
  41. self.serving = False
  42. @@ -1002,6 +1005,7 @@
  43. snapshot = self.patches.pop()
  44. snapshot.restore()
  45. assert not self.patches
  46. + self.display.stop()
  47.  
  48. def poll_server(self):
  49. self.serving = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement