Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
titi
committed
Nov 2, 2012
1 parent
c13b5fd
commit 33796e9
Showing
3 changed files
with
101 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
''' | ||
two calls | ||
''' | ||
import logging | ||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
from easyprocess import EasyProcess | ||
from pyvirtualdisplay.smartdisplay import SmartDisplay | ||
|
||
backend1 = 'wx' | ||
backend2 = 'wx' | ||
|
||
|
||
with SmartDisplay(visible=0, bgcolor='black') as disp: | ||
disp.pyscreenshot_backend = backend1 | ||
with EasyProcess('xmessage test1'): | ||
img1 = disp.waitgrab() | ||
|
||
with SmartDisplay(visible=0, bgcolor='black') as disp: | ||
disp.pyscreenshot_backend = backend2 | ||
with EasyProcess('xmessage test2'): | ||
img2 = disp.waitgrab() | ||
|
||
img1.show() | ||
img2.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from easyprocess import EasyProcess | ||
from nose.tools import eq_ | ||
from pyvirtualdisplay.smartdisplay import SmartDisplay, DisplayTimeoutError | ||
from unittest import TestCase | ||
from path import path | ||
import pyscreenshot | ||
|
||
|
||
class Test(TestCase): | ||
def check_double(self, backend1, backend2=None): | ||
if not backend2: | ||
backend2 = backend1 | ||
|
||
with SmartDisplay(visible=0, bgcolor='black') as disp: | ||
disp.pyscreenshot_backend = backend1 | ||
with EasyProcess('xmessage hello1'): | ||
img = disp.waitgrab() | ||
eq_(img is not None, True) | ||
|
||
with SmartDisplay(visible=0, bgcolor='black') as disp: | ||
disp.pyscreenshot_backend = backend2 | ||
with EasyProcess('xmessage hello2'): | ||
img = disp.waitgrab() | ||
eq_(img is not None, True) | ||
|
||
def test_double_wx(self): | ||
self.check_double('wx') | ||
|
||
def test_double_pygtk(self): | ||
self.check_double('pygtk') | ||
|
||
def test_double_pyqt(self): | ||
self.check_double('pyqt') | ||
|
||
def test_double_imagemagick(self): | ||
self.check_double('imagemagick') | ||
|
||
def test_double_scrot(self): | ||
self.check_double('scrot') | ||
|
||
def test_double_wx_pygtk(self): | ||
self.check_double('wx', 'pygtk') | ||
|
||
def test_double_wx_pyqt(self): | ||
self.check_double('wx', 'pyqt') | ||
|
||
def test_double_pygtk_pyqt(self): | ||
self.check_double('pygtk', 'pyqt') | ||
|
||
|