flattened package to module and updated setup and tests

This commit is contained in:
Corey Goldberg 2013-10-08 13:42:48 -04:00
parent 55701d643f
commit becf66efc9
7 changed files with 12 additions and 17 deletions

View File

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

View File

@ -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

View File

@ -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)',

View File

@ -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)

View File

@ -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

View File

@ -1,2 +0,0 @@
__version__ = '0.2.3'