Browse Source

flattened package to module and updated setup and tests

changes/49/376949/1 0.2.4
Corey Goldberg 8 years ago
parent
commit
becf66efc9
  1. 3
      MANIFEST.in
  2. 4
      README.rst
  3. 6
      setup.py
  4. 12
      test_xvfb.py
  5. 2
      tox.ini
  6. 0
      xvfbwrapper.py
  7. 2
      xvfbwrapper/__init__.py

3
MANIFEST.in

@ -1,4 +1,3 @@
prune *
include README.rst
include setup.py
recursive-include xvfbwrapper *.py
include *.py

4
README.rst

@ -24,13 +24,13 @@ Install xvfbwrapper from PyPI::
***********************
* Xvfb (`sudo apt-get install xvfb`, or similar)
* Python 2.7 or 3.2+ (tested on py27, py32, py33, pypy)
* Python 2.7 or 3.2+ (tested on py27, py32, py33)
**************************************
About Xvfb (X Virtual Framebuffer)
**************************************
In the X Window System, Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. This virtual server does not require the computer it is running on to even have a screen or any input device. Only a network layer is necessary.
In the X Window System, Xvfb or X Virtual FrameBuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. This virtual server does not require the computer it is running on to even have a screen or any input device. Only a network layer is necessary.
************************
Example: Basic Usage

6
setup.py

@ -7,8 +7,6 @@
import os
from distutils.core import setup
import xvfbwrapper
this_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_dir, 'README.rst')) as f:
@ -17,8 +15,8 @@ with open(os.path.join(this_dir, 'README.rst')) as f:
setup(
name='xvfbwrapper',
version=xvfbwrapper.__version__,
packages=['xvfbwrapper'],
version='0.2.4',
py_modules=['xvfbwrapper'],
author='Corey Goldberg',
author_email='cgoldberg _at_ gmail.com',
description='run headless display inside X virtual framebuffer (Xvfb)',

12
xvfbwrapper/test_xvfb.py → test_xvfb.py

@ -1,7 +1,7 @@
#!/usr/bin/env python
from .xvfbwrapper import Xvfb
from xvfbwrapper import Xvfb
import os
import sys
@ -22,7 +22,7 @@ class TestXvfb(unittest.TestCase):
self.addCleanup(xvfb.stop)
xvfb.start()
self.assertEqual(':%d' % xvfb.vdisplay_num, os.environ['DISPLAY'])
self.assertIsNot(None, xvfb.proc)
self.assertIsNotNone(xvfb.proc)
def test_stop(self):
orig_display = os.environ['DISPLAY']
@ -30,15 +30,15 @@ class TestXvfb(unittest.TestCase):
xvfb.start()
self.assertNotEqual(orig_display, os.environ['DISPLAY'])
xvfb.stop()
self.assertIs(None, xvfb.proc)
self.assertIsNone(xvfb.proc)
self.assertEqual(orig_display, os.environ['DISPLAY'])
def test_as_context_manager(self):
orig_display = os.environ['DISPLAY']
with Xvfb() as xvfb:
self.assertEqual(':%d' % xvfb.vdisplay_num, os.environ['DISPLAY'])
self.assertIsNot(None, xvfb.proc)
self.assertIs(None, xvfb.proc)
self.assertIsNotNone(xvfb.proc)
self.assertIsNone(xvfb.proc)
self.assertEqual(orig_display, os.environ['DISPLAY'])
def test_start_with_kwargs(self):
@ -59,4 +59,4 @@ class TestXvfb(unittest.TestCase):
self.addCleanup(xvfb.stop)
xvfb.start()
self.assertEqual(os.environ['DISPLAY'], ':%d' % xvfb.vdisplay_num)
self.assertIsNot(None, xvfb.proc)
self.assertIsNotNone(xvfb.proc)

2
tox.ini

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = flake8, py27, py32, py33, pypy
envlist = flake8, py27, py32, py33
[flake8]
exclude = .tox, build

0
xvfbwrapper/xvfbwrapper.py → xvfbwrapper.py

2
xvfbwrapper/__init__.py

@ -1,2 +0,0 @@
__version__ = '0.2.3'
Loading…
Cancel
Save