Index: server/lib/gutenbach_test/__init__.py
===================================================================
--- server/lib/gutenbach_test/__init__.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/__init__.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,8 @@
+import ipp
+import server
+
+from ipp import *
+from server import *
+
+__all__ = ipp.__all__ + \
+          server.__all__
Index: server/lib/gutenbach_test/ipp/__init__.py
===================================================================
--- server/lib/gutenbach_test/ipp/__init__.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/ipp/__init__.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,17 @@
+import attribute
+import attributegroup
+import attributes
+import request
+import value
+
+from attribute import *
+from attributegroup import *
+from attributes import *
+from request import *
+from value import *
+
+__all__ = attribute.__all__ + \
+          attributegroup.__all__ + \
+          attributes.__all__ + \
+          request.__all__ + \
+          value.__all__
Index: server/lib/gutenbach_test/ipp/attribute.py
===================================================================
--- server/lib/gutenbach_test/ipp/attribute.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/ipp/attribute.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/gutenbach_test/ipp/attributegroup.py
===================================================================
--- server/lib/gutenbach_test/ipp/attributegroup.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/ipp/attributegroup.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/gutenbach_test/ipp/attributes.py
===================================================================
--- server/lib/gutenbach_test/ipp/attributes.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/ipp/attributes.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/gutenbach_test/ipp/request.py
===================================================================
--- server/lib/gutenbach_test/ipp/request.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/ipp/request.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/gutenbach_test/ipp/value.py
===================================================================
--- server/lib/gutenbach_test/ipp/value.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/ipp/value.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/gutenbach_test/server/__init__.py
===================================================================
--- server/lib/gutenbach_test/server/__init__.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/server/__init__.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,14 @@
+import job
+import printer
+import player
+import requests
+
+from job import *
+from printer import *
+from player import *
+from requests import *
+
+__all__ = job.__all__ + \
+          printer.__all__ + \
+          player.__all__ + \
+          requests.__all__
Index: server/lib/gutenbach_test/server/job.py
===================================================================
--- server/lib/gutenbach_test/server/job.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/server/job.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,228 @@
+__all__ = [
+    'TestEmptyGutenbachJob',
+    'TestBadGutenbachJob',
+    'TestGutenbachJobOperations',
+    ]
+
+from gutenbach.server import GutenbachJob
+from gutenbach.server import errors
+from gutenbach.ipp import JobStates as States
+import unittest
+import tempfile
+import sys
+import time
+import logging
+
+def make_tempfile():
+    fh = tempfile.NamedTemporaryFile()
+    fh.write("test\n")
+    fh.seek(0)
+    return fh
+
+class TestEmptyGutenbachJob(unittest.TestCase):
+
+    def setUp(self):
+        self.job = GutenbachJob()
+
+    def testPlayer(self):
+        self.assertEqual(self.job.player, None)
+    def testId(self):
+        self.assertEqual(self.job.id, -1)
+    def testCreator(self):
+        self.assertEqual(self.job.creator, "")
+    def testName(self):
+        self.assertEqual(self.job.name, "")
+    def testSize(self):
+        self.assertEqual(self.job.size, 0)
+    def testState(self):
+        self.assertEqual(self.job.state, States.HELD)
+    def testPriority(self):
+        self.assertEqual(self.job.priority, 1)
+
+    def testStateProperties(self):
+        self.assertFalse(self.job.is_valid)
+        self.assertFalse(self.job.is_ready)
+        self.assertFalse(self.job.is_playing)
+        self.assertFalse(self.job.is_paused)
+        self.assertFalse(self.job.is_done)
+        self.assertFalse(self.job.is_completed)
+        self.assertFalse(self.job.is_cancelled)
+        self.assertFalse(self.job.is_aborted)
+
+    def testSpool(self):
+        fh = tempfile.NamedTemporaryFile()
+        self.assertRaises(errors.InvalidJobStateException, self.job.spool, fh)
+        fh.close()
+    def testPlay(self):
+        self.assertRaises(errors.InvalidJobStateException, self.job.play)
+    def testPause(self):
+        self.assertRaises(errors.InvalidJobStateException, self.job.pause)
+    def testCancel(self):
+        self.job.cancel()
+        self.assertTrue(self.job.is_cancelled)
+        self.assertEqual(self.job.state, States.CANCELLED)
+    def testAbort(self):
+        self.job.abort()
+        self.assertTrue(self.job.is_aborted)
+        self.assertEqual(self.job.state, States.ABORTED)
+
+class TestBadGutenbachJob(unittest.TestCase):
+
+    def testBadJobId(self):
+        job = GutenbachJob(job_id=-2)
+        self.assertEqual(job.id, -1)
+        job.id = -2
+        self.assertEqual(job.id, -1)
+
+    def testBadCreator(self):
+        job = GutenbachJob(
+            job_id=1,
+            creator=12345)
+        self.assertEqual(job.creator, "12345")
+        job.creator = None
+        self.assertEqual(job.creator, "")
+        job.creator = []
+        self.assertEqual(job.creator, "[]")
+
+    def testBadName(self):
+        job = GutenbachJob(
+            job_id=1,
+            creator="foo",
+            name=12345)
+        self.assertEqual(job.name, "12345")
+        job.name = None
+        self.assertEqual(job.name, "")
+        job.name = []
+        self.assertEqual(job.name, "[]")
+
+    def testBadPriority(self):
+        job = GutenbachJob(
+            job_id=1,
+            creator="foo",
+            name="test",
+            priority=-1)
+        self.assertEqual(job.priority, 1)
+        job.priority = 0
+        self.assertEqual(job.priority, 1)
+        job.priority = 1
+        self.assertEqual(job.priority, 1)
+        job.priority = sys.maxint
+        self.assertEqual(job.priority, sys.maxint)
+        job.priority = "hello"
+        self.assertEqual(job.priority, 1)
+        job.priority = []
+        self.assertEqual(job.priority, 1)
+
+    def testBadDocument(self):
+        job = GutenbachJob(
+            job_id=1,
+            creator="foo",
+            name="test",
+            priority=1)
+        self.assertRaises(errors.InvalidDocument, job.spool, "hello")
+        self.assertRaises(errors.InvalidDocument, job.spool, [])
+        self.assertRaises(errors.InvalidDocument, job.spool, 12345)
+
+        fh = make_tempfile()
+        job = GutenbachJob(
+            job_id=1,
+            creator="foo",
+            name="test",
+            priority=1,
+            document=fh)
+        self.assertRaises(errors.InvalidJobStateException, job.spool, "hello")
+        self.assertRaises(errors.InvalidJobStateException, job.spool, [])
+        self.assertRaises(errors.InvalidJobStateException, job.spool, 12345)
+
+class TestGutenbachJobOperations(unittest.TestCase):
+
+    def setUp(self):
+        fh = make_tempfile()
+        self.job = GutenbachJob(
+            job_id=1,
+            creator="foo",
+            name="test",
+            priority=1,
+            document=fh)
+        self.job.player._dryrun = True
+
+    def testPlay(self):
+        self.job.play()
+        self.assertTrue(self.job.is_playing)
+
+        while self.job.is_playing:
+            time.sleep(0.1)
+
+        self.assertTrue(self.job.is_done)
+        self.assertTrue(self.job.is_completed)
+        self.assertFalse(self.job.is_aborted)
+        self.assertFalse(self.job.is_cancelled)
+
+    def testPause(self):
+        self.job.play()
+        self.assertTrue(self.job.is_playing)
+        self.assertFalse(self.job.is_paused)
+
+        self.job.pause()
+        self.assertTrue(self.job.is_playing)
+        self.assertTrue(self.job.is_paused)
+
+        time.sleep(0.6)
+        self.assertTrue(self.job.is_playing)
+        self.assertTrue(self.job.is_paused)
+
+        self.job.pause()
+        self.assertTrue(self.job.is_playing)
+        self.assertFalse(self.job.is_paused)
+        
+        while self.job.is_playing:
+            time.sleep(0.1)
+            
+        self.assertTrue(self.job.is_done)
+        self.assertTrue(self.job.is_completed)
+        self.assertFalse(self.job.is_aborted)
+        self.assertFalse(self.job.is_cancelled)
+
+    def testCancel(self):
+        self.job.play()
+        self.assertTrue(self.job.is_playing)
+        self.assertFalse(self.job.is_cancelled)
+
+        self.job.cancel()
+        self.assertFalse(self.job.is_playing)
+        self.assertTrue(self.job.is_done)
+        self.assertTrue(self.job.is_cancelled)
+        self.assertFalse(self.job.is_aborted)
+
+    def testAbort(self):
+        self.job.play()
+        self.assertTrue(self.job.is_playing)
+        self.assertFalse(self.job.is_aborted)
+
+        self.job.abort()
+        self.assertFalse(self.job.is_playing)
+        self.assertTrue(self.job.is_done)
+        self.assertFalse(self.job.is_cancelled)
+        self.assertTrue(self.job.is_aborted)
+
+    def testRestart(self):
+        self.assertRaises(errors.InvalidJobStateException, self.job.restart)
+
+        self.job.play()
+        self.assertTrue(self.job.is_playing)
+        self.assertFalse(self.job.is_done)
+
+        self.assertRaises(errors.InvalidJobStateException, self.job.restart)
+
+        self.job.cancel()
+        self.assertFalse(self.job.is_playing)
+        self.assertTrue(self.job.is_done)
+        self.assertTrue(self.job.is_cancelled)
+        self.assertFalse(self.job.is_aborted)
+
+        self.job.restart()
+        self.assertTrue(self.job.is_ready)
+
+if __name__ == "__main__":
+    logging.basicConfig(loglevel=logging.CRITICAL)
+    unittest.main()
Index: server/lib/gutenbach_test/server/player.py
===================================================================
--- server/lib/gutenbach_test/server/player.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/server/player.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/gutenbach_test/server/printer.py
===================================================================
--- server/lib/gutenbach_test/server/printer.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/server/printer.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,258 @@
+__all__ = [
+    'TestEmptyGutenbachPrinter',
+    'TestBadEmptyGutenbachPrinter',
+    'TestGutenbachPrinter',
+    ]
+
+from gutenbach.server import GutenbachJob
+from gutenbach.server import GutenbachPrinter
+from gutenbach.server import errors
+
+from gutenbach.ipp import PrinterStates as States
+import unittest
+import tempfile
+import time
+import logging
+import threading
+
+def make_tempfile():
+    fh = tempfile.NamedTemporaryFile()
+    fh.write("test\n")
+    fh.seek(0)
+    return fh
+
+class TestEmptyGutenbachPrinter(unittest.TestCase):
+
+    testJobName = "unique_test_job"
+    testJobRequestingUserName = "unique_test_username"
+    testPrinterConfig = {
+        'ipp-versions': ["1.0", "1.1"]
+        }
+
+    def setUp(self):
+        self.printer = GutenbachPrinter("test", self.testPrinterConfig)
+
+    def testName(self):
+        self.assertEqual(self.printer.name, "test")
+    def testConfig(self):
+        self.assertEqual(self.printer.config, self.testPrinterConfig)
+    def testTimeCreated(self):
+        self.assertTrue(self.printer.time_created is not None)
+    def testFinishedJobs(self):
+        self.assertEqual(self.printer.finished_jobs, [])
+    def testPendingJobs(self):
+        self.assertEqual(self.printer.pending_jobs, [])
+    def testCurrentJob(self):
+        self.assertEqual(self.printer.current_job, None)
+    def testJobs(self):
+        self.assertEqual(self.printer.jobs, {})
+    def testActiveJobs(self):
+        self.assertEqual(self.printer.active_jobs, [])
+    def testRunning(self):
+        self.assertEqual(self.printer.is_running, False)
+    def testPaused(self):
+        self.assertEqual(self.printer.paused, False)
+    def testNextJobId(self):
+        self.assertEqual(self.printer._next_job_id, 1)
+    def testState(self):
+        self.assertEqual(self.printer.state, States.STOPPED)
+
+    def testStartJob(self):
+        self.assertRaises(RuntimeError, self.printer.start_job)
+    def testCompleteJob(self):
+        self.assertRaises(RuntimeError, self.printer.complete_job)
+    def testGetJob(self):
+        self.assertRaises(RuntimeError, self.printer.get_job, 0)
+
+    def testIPPAttributes(self):
+        for attribute in self.printer.printer_attributes:
+            attr = attribute.replace("-", "_")
+            self.assertRaises(RuntimeError, getattr, self.printer, attr)
+            self.assertRaises(RuntimeError, setattr, self.printer, attr, None)
+        for attribute in self.printer.job_attributes:
+            attr = getattr(self.printer, attribute.replace("-", "_"))
+            self.assertRaises(RuntimeError, attr, 0)
+
+    def testIPPOperations(self):
+        self.assertRaises(RuntimeError, self.printer.print_job, None)
+        self.assertRaises(RuntimeError, self.printer.validate_job)
+        self.assertRaises(RuntimeError, self.printer.get_jobs)
+        self.assertRaises(RuntimeError, self.printer.print_uri)
+        self.assertRaises(RuntimeError, self.printer.create_job)
+        self.assertRaises(RuntimeError, self.printer.pause_printer)
+        self.assertRaises(RuntimeError, self.printer.resume_printer)
+        self.assertRaises(RuntimeError, self.printer.get_printer_attributes)
+        self.assertRaises(RuntimeError, self.printer.set_printer_attributes, {})
+        self.assertRaises(RuntimeError, self.printer.cancel_job, 0)
+        self.assertRaises(RuntimeError, self.printer.send_document, 0, None)
+        self.assertRaises(RuntimeError, self.printer.send_uri, 0, "")
+        self.assertRaises(RuntimeError, self.printer.get_job_attributes, 0)
+        self.assertRaises(RuntimeError, self.printer.set_job_attributes, 0, {})
+        self.assertRaises(RuntimeError, self.printer.restart_job, 0)
+        self.assertRaises(RuntimeError, self.printer.promote_job, 0)
+
+class TestBadEmptyGutenbachPrinter(unittest.TestCase):
+
+    testJobName = "unique_test_job"
+    testJobRequestingUserName = "unique_test_username"
+    testPrinterConfig = {
+        'ipp-versions': ["1.0", "1.1"]
+        }
+
+    def testBadPrinterName(self):
+        printer = GutenbachPrinter(None, self.testPrinterConfig)
+        self.assertEqual(printer.name, "None")
+        printer.name = "foo"
+        self.assertEqual(printer.name, "foo")
+        printer.name = 1234
+        self.assertEqual(printer.name, "1234")
+        printer.name = []
+        self.assertEqual(printer.name, "[]")
+
+    def testBadConfig(self):
+        self.assertRaises(ValueError, GutenbachPrinter, "test", {})
+        self.assertRaises(ValueError, GutenbachPrinter, "test", {"hello": 1234})
+        self.assertRaises(ValueError, GutenbachPrinter, "test", [])
+        self.assertRaises(ValueError, GutenbachPrinter, "test", 1234)
+        self.assertRaises(ValueError, GutenbachPrinter, "test", "hello")
+        conf = self.testPrinterConfig.copy()
+        printer = GutenbachPrinter("test", conf)
+        printer.config = conf.items()
+        self.assertEqual(printer.config, conf)
+        conf["hello"] = "goodbye"
+        self.assertNotEqual(printer.config, conf)
+        printer.config = conf
+        self.assertEqual(printer.config, conf)
+
+class TestGutenbachPrinter(unittest.TestCase):
+
+    testJobName = "unique_test_job"
+    testJobRequestingUserName = "unique_test_username"
+    testPrinterConfig = {
+        'ipp-versions': ["1.0", "1.1"],
+        'dryrun': True
+        }
+
+    def setUp(self):
+        self.printer = GutenbachPrinter("test", self.testPrinterConfig)
+        self.printer.start()
+        while not self.printer.is_running:
+            time.sleep(0.01)
+
+    def tearDown(self):
+        self.printer.stop()
+
+    def createTestJob(self):
+        job_id = self.printer.create_job(
+            self.testJobRequestingUserName,
+            self.testJobName)
+        return job_id
+
+    def testPrintJob(self):
+        pass
+
+    def testValidateJob(self):
+        pass
+
+    def testGetJobs(self):
+        pass
+
+    def testPrintUri(self):
+        pass
+
+    def testCreateJob(self):
+        for i in xrange(2):
+            countBeforeAdded = len(self.printer.jobs)
+            job = self.createTestJob()
+            self.assertEqual(len(self.printer.jobs) - 1, countBeforeAdded)
+            self.printer.send_document(job, make_tempfile())
+            self.assertTrue(job in self.printer.pending_jobs)
+            self.assertFalse(job in self.printer.finished_jobs)
+            self.assertEqual(self.printer.state, States.PROCESSING)
+
+        while len(self.printer.active_jobs) > 0:
+            time.sleep(0.01)
+        self.assertEqual(self.printer.state, States.IDLE)
+
+    def testPausePrinter(self):
+        job = self.createTestJob()
+        self.printer.send_document(job, make_tempfile())
+        job = self.createTestJob()
+        self.printer.send_document(job, make_tempfile())
+        self.assertTrue(self.printer.is_running)
+        self.assertEqual(self.printer.state, States.PROCESSING)
+        self.assertFalse(self.printer.paused)
+
+        while self.printer.current_job is None:
+            time.sleep(0.01)
+
+        self.printer.pause_printer()
+        self.assertTrue(self.printer.paused)
+        time.sleep(0.6)
+        self.assertTrue(self.printer.current_job is not None)
+        self.assertEqual(self.printer.state, States.STOPPED)
+
+        # check that no jobs are playing
+        for job_id, job in self.printer.jobs.items():
+            self.assertEqual(job.is_paused, job.is_playing)
+
+    def testResumePrinter(self):
+        job = self.createTestJob()
+        self.printer.send_document(job, make_tempfile())
+        job = self.createTestJob()
+        self.printer.send_document(job, make_tempfile())
+        self.assertTrue(self.printer.is_running)
+        self.assertEqual(self.printer.state, States.PROCESSING)
+        self.assertFalse(self.printer.paused)
+
+        while self.printer.current_job is None:
+            time.sleep(0.01)
+
+        self.printer.pause_printer()
+        self.assertTrue(self.printer.paused)
+        time.sleep(0.6)
+        self.assertTrue(self.printer.current_job is not None)
+        self.assertEqual(self.printer.state, States.STOPPED)
+
+        # check that no jobs are playing
+        for job_id, job in self.printer.jobs.items():
+            self.assertEqual(job.is_paused, job.is_playing)
+
+        self.printer.resume_printer()
+        self.assertFalse(self.printer.paused)
+        self.assertEqual(self.printer.state, States.PROCESSING)
+
+        while len(self.printer.active_jobs) > 0:
+            time.sleep(0.01)
+        self.assertEqual(self.printer.state, States.IDLE)
+
+    def testGetPrinterAttributes(self):
+        pass
+
+    def testSetPrinterAttributes(self):
+        pass
+
+    def testCancelJob(self):
+        pass
+
+    def testSendDocument(self):
+        pass
+
+    def testSendUri(self):
+        pass
+
+    def testGetJobAttributes(self):
+        pass
+
+    def testSetJobAttributes(self):
+        pass
+
+    def testRestartJob(self):
+        pass
+
+    def testPromoteJob(self):
+        pass
+
+if __name__ == "__main__":
+    logging.basicConfig(loglevel=logging.DEBUG)
+    unittest.main()
Index: server/lib/gutenbach_test/server/requests.py
===================================================================
--- server/lib/gutenbach_test/server/requests.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/gutenbach_test/server/requests.py	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,1 @@
+__all__ = []
Index: server/lib/runtests
===================================================================
--- server/lib/runtests	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
+++ server/lib/runtests	(revision 5ffffe0cbb1a96c2598d17f589750e16b7689ab7)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+python -m unittest -v gutenbach_test
Index: rver/test/server/job.py
===================================================================
--- server/test/server/job.py	(revision 0494098be71273aa720ffe002e05a27ae68284e3)
+++ 	(revision )
@@ -1,222 +1,0 @@
-from gutenbach.server import GutenbachJob
-from gutenbach.server import errors
-from gutenbach.ipp import JobStates as States
-import unittest
-import tempfile
-import sys
-import time
-import logging
-
-def make_tempfile():
-    fh = tempfile.NamedTemporaryFile()
-    fh.write("test\n")
-    fh.seek(0)
-    return fh
-
-class TestEmptyGutenbachJob(unittest.TestCase):
-
-    def setUp(self):
-        self.job = GutenbachJob()
-
-    def testPlayer(self):
-        self.assertEqual(self.job.player, None)
-    def testId(self):
-        self.assertEqual(self.job.id, -1)
-    def testCreator(self):
-        self.assertEqual(self.job.creator, "")
-    def testName(self):
-        self.assertEqual(self.job.name, "")
-    def testSize(self):
-        self.assertEqual(self.job.size, 0)
-    def testState(self):
-        self.assertEqual(self.job.state, States.HELD)
-    def testPriority(self):
-        self.assertEqual(self.job.priority, 1)
-
-    def testStateProperties(self):
-        self.assertFalse(self.job.is_valid)
-        self.assertFalse(self.job.is_ready)
-        self.assertFalse(self.job.is_playing)
-        self.assertFalse(self.job.is_paused)
-        self.assertFalse(self.job.is_done)
-        self.assertFalse(self.job.is_completed)
-        self.assertFalse(self.job.is_cancelled)
-        self.assertFalse(self.job.is_aborted)
-
-    def testSpool(self):
-        fh = tempfile.NamedTemporaryFile()
-        self.assertRaises(errors.InvalidJobStateException, self.job.spool, fh)
-        fh.close()
-    def testPlay(self):
-        self.assertRaises(errors.InvalidJobStateException, self.job.play)
-    def testPause(self):
-        self.assertRaises(errors.InvalidJobStateException, self.job.pause)
-    def testCancel(self):
-        self.job.cancel()
-        self.assertTrue(self.job.is_cancelled)
-        self.assertEqual(self.job.state, States.CANCELLED)
-    def testAbort(self):
-        self.job.abort()
-        self.assertTrue(self.job.is_aborted)
-        self.assertEqual(self.job.state, States.ABORTED)
-
-class TestBadGutenbachJob(unittest.TestCase):
-
-    def testBadJobId(self):
-        job = GutenbachJob(job_id=-2)
-        self.assertEqual(job.id, -1)
-        job.id = -2
-        self.assertEqual(job.id, -1)
-
-    def testBadCreator(self):
-        job = GutenbachJob(
-            job_id=1,
-            creator=12345)
-        self.assertEqual(job.creator, "12345")
-        job.creator = None
-        self.assertEqual(job.creator, "")
-        job.creator = []
-        self.assertEqual(job.creator, "[]")
-
-    def testBadName(self):
-        job = GutenbachJob(
-            job_id=1,
-            creator="foo",
-            name=12345)
-        self.assertEqual(job.name, "12345")
-        job.name = None
-        self.assertEqual(job.name, "")
-        job.name = []
-        self.assertEqual(job.name, "[]")
-
-    def testBadPriority(self):
-        job = GutenbachJob(
-            job_id=1,
-            creator="foo",
-            name="test",
-            priority=-1)
-        self.assertEqual(job.priority, 1)
-        job.priority = 0
-        self.assertEqual(job.priority, 1)
-        job.priority = 1
-        self.assertEqual(job.priority, 1)
-        job.priority = sys.maxint
-        self.assertEqual(job.priority, sys.maxint)
-        job.priority = "hello"
-        self.assertEqual(job.priority, 1)
-        job.priority = []
-        self.assertEqual(job.priority, 1)
-
-    def testBadDocument(self):
-        job = GutenbachJob(
-            job_id=1,
-            creator="foo",
-            name="test",
-            priority=1)
-        self.assertRaises(errors.InvalidDocument, job.spool, "hello")
-        self.assertRaises(errors.InvalidDocument, job.spool, [])
-        self.assertRaises(errors.InvalidDocument, job.spool, 12345)
-
-        fh = make_tempfile()
-        job = GutenbachJob(
-            job_id=1,
-            creator="foo",
-            name="test",
-            priority=1,
-            document=fh)
-        self.assertRaises(errors.InvalidJobStateException, job.spool, "hello")
-        self.assertRaises(errors.InvalidJobStateException, job.spool, [])
-        self.assertRaises(errors.InvalidJobStateException, job.spool, 12345)
-
-class TestOperations(unittest.TestCase):
-
-    def setUp(self):
-        fh = make_tempfile()
-        self.job = GutenbachJob(
-            job_id=1,
-            creator="foo",
-            name="test",
-            priority=1,
-            document=fh)
-        self.job.player._dryrun = True
-
-    def testPlay(self):
-        self.job.play()
-        self.assertTrue(self.job.is_playing)
-
-        while self.job.is_playing:
-            time.sleep(0.1)
-
-        self.assertTrue(self.job.is_done)
-        self.assertTrue(self.job.is_completed)
-        self.assertFalse(self.job.is_aborted)
-        self.assertFalse(self.job.is_cancelled)
-
-    def testPause(self):
-        self.job.play()
-        self.assertTrue(self.job.is_playing)
-        self.assertFalse(self.job.is_paused)
-
-        self.job.pause()
-        self.assertTrue(self.job.is_playing)
-        self.assertTrue(self.job.is_paused)
-
-        time.sleep(0.6)
-        self.assertTrue(self.job.is_playing)
-        self.assertTrue(self.job.is_paused)
-
-        self.job.pause()
-        self.assertTrue(self.job.is_playing)
-        self.assertFalse(self.job.is_paused)
-        
-        while self.job.is_playing:
-            time.sleep(0.1)
-            
-        self.assertTrue(self.job.is_done)
-        self.assertTrue(self.job.is_completed)
-        self.assertFalse(self.job.is_aborted)
-        self.assertFalse(self.job.is_cancelled)
-
-    def testCancel(self):
-        self.job.play()
-        self.assertTrue(self.job.is_playing)
-        self.assertFalse(self.job.is_cancelled)
-
-        self.job.cancel()
-        self.assertFalse(self.job.is_playing)
-        self.assertTrue(self.job.is_done)
-        self.assertTrue(self.job.is_cancelled)
-        self.assertFalse(self.job.is_aborted)
-
-    def testAbort(self):
-        self.job.play()
-        self.assertTrue(self.job.is_playing)
-        self.assertFalse(self.job.is_aborted)
-
-        self.job.abort()
-        self.assertFalse(self.job.is_playing)
-        self.assertTrue(self.job.is_done)
-        self.assertFalse(self.job.is_cancelled)
-        self.assertTrue(self.job.is_aborted)
-
-    def testRestart(self):
-        self.assertRaises(errors.InvalidJobStateException, self.job.restart)
-
-        self.job.play()
-        self.assertTrue(self.job.is_playing)
-        self.assertFalse(self.job.is_done)
-
-        self.assertRaises(errors.InvalidJobStateException, self.job.restart)
-
-        self.job.cancel()
-        self.assertFalse(self.job.is_playing)
-        self.assertTrue(self.job.is_done)
-        self.assertTrue(self.job.is_cancelled)
-        self.assertFalse(self.job.is_aborted)
-
-        self.job.restart()
-        self.assertTrue(self.job.is_ready)
-
-if __name__ == "__main__":
-    logging.basicConfig(loglevel=logging.CRITICAL)
-    unittest.main()
Index: rver/test/server/printer.py
===================================================================
--- server/test/server/printer.py	(revision d42236e713a7da2a8fc9f482a69e7ff5ab4fc8f5)
+++ 	(revision )
@@ -1,252 +1,0 @@
-from gutenbach.server import GutenbachJob
-from gutenbach.server import GutenbachPrinter
-from gutenbach.server import errors
-
-from gutenbach.ipp import PrinterStates as States
-import unittest
-import tempfile
-import time
-import logging
-import threading
-
-def make_tempfile():
-    fh = tempfile.NamedTemporaryFile()
-    fh.write("test\n")
-    fh.seek(0)
-    return fh
-
-class TestEmptyGutenbachPrinter(unittest.TestCase):
-
-    testJobName = "unique_test_job"
-    testJobRequestingUserName = "unique_test_username"
-    testPrinterConfig = {
-        'ipp-versions': ["1.0", "1.1"]
-        }
-
-    def setUp(self):
-        self.printer = GutenbachPrinter("test", self.testPrinterConfig)
-
-    def testName(self):
-        self.assertEqual(self.printer.name, "test")
-    def testConfig(self):
-        self.assertEqual(self.printer.config, self.testPrinterConfig)
-    def testTimeCreated(self):
-        self.assertTrue(self.printer.time_created is not None)
-    def testFinishedJobs(self):
-        self.assertEqual(self.printer.finished_jobs, [])
-    def testPendingJobs(self):
-        self.assertEqual(self.printer.pending_jobs, [])
-    def testCurrentJob(self):
-        self.assertEqual(self.printer.current_job, None)
-    def testJobs(self):
-        self.assertEqual(self.printer.jobs, {})
-    def testActiveJobs(self):
-        self.assertEqual(self.printer.active_jobs, [])
-    def testRunning(self):
-        self.assertEqual(self.printer.is_running, False)
-    def testPaused(self):
-        self.assertEqual(self.printer.paused, False)
-    def testNextJobId(self):
-        self.assertEqual(self.printer._next_job_id, 1)
-    def testState(self):
-        self.assertEqual(self.printer.state, States.STOPPED)
-
-    def testStartJob(self):
-        self.assertRaises(RuntimeError, self.printer.start_job)
-    def testCompleteJob(self):
-        self.assertRaises(RuntimeError, self.printer.complete_job)
-    def testGetJob(self):
-        self.assertRaises(RuntimeError, self.printer.get_job, 0)
-
-    def testIPPAttributes(self):
-        for attribute in self.printer.printer_attributes:
-            attr = attribute.replace("-", "_")
-            self.assertRaises(RuntimeError, getattr, self.printer, attr)
-            self.assertRaises(RuntimeError, setattr, self.printer, attr, None)
-        for attribute in self.printer.job_attributes:
-            attr = getattr(self.printer, attribute.replace("-", "_"))
-            self.assertRaises(RuntimeError, attr, 0)
-
-    def testIPPOperations(self):
-        self.assertRaises(RuntimeError, self.printer.print_job, None)
-        self.assertRaises(RuntimeError, self.printer.validate_job)
-        self.assertRaises(RuntimeError, self.printer.get_jobs)
-        self.assertRaises(RuntimeError, self.printer.print_uri)
-        self.assertRaises(RuntimeError, self.printer.create_job)
-        self.assertRaises(RuntimeError, self.printer.pause_printer)
-        self.assertRaises(RuntimeError, self.printer.resume_printer)
-        self.assertRaises(RuntimeError, self.printer.get_printer_attributes)
-        self.assertRaises(RuntimeError, self.printer.set_printer_attributes, {})
-        self.assertRaises(RuntimeError, self.printer.cancel_job, 0)
-        self.assertRaises(RuntimeError, self.printer.send_document, 0, None)
-        self.assertRaises(RuntimeError, self.printer.send_uri, 0, "")
-        self.assertRaises(RuntimeError, self.printer.get_job_attributes, 0)
-        self.assertRaises(RuntimeError, self.printer.set_job_attributes, 0, {})
-        self.assertRaises(RuntimeError, self.printer.restart_job, 0)
-        self.assertRaises(RuntimeError, self.printer.promote_job, 0)
-
-class TestBadEmptyGutenbachPrinter(unittest.TestCase):
-
-    testJobName = "unique_test_job"
-    testJobRequestingUserName = "unique_test_username"
-    testPrinterConfig = {
-        'ipp-versions': ["1.0", "1.1"]
-        }
-
-    def testBadPrinterName(self):
-        printer = GutenbachPrinter(None, self.testPrinterConfig)
-        self.assertEqual(printer.name, "None")
-        printer.name = "foo"
-        self.assertEqual(printer.name, "foo")
-        printer.name = 1234
-        self.assertEqual(printer.name, "1234")
-        printer.name = []
-        self.assertEqual(printer.name, "[]")
-
-    def testBadConfig(self):
-        self.assertRaises(ValueError, GutenbachPrinter, "test", {})
-        self.assertRaises(ValueError, GutenbachPrinter, "test", {"hello": 1234})
-        self.assertRaises(ValueError, GutenbachPrinter, "test", [])
-        self.assertRaises(ValueError, GutenbachPrinter, "test", 1234)
-        self.assertRaises(ValueError, GutenbachPrinter, "test", "hello")
-        conf = self.testPrinterConfig.copy()
-        printer = GutenbachPrinter("test", conf)
-        printer.config = conf.items()
-        self.assertEqual(printer.config, conf)
-        conf["hello"] = "goodbye"
-        self.assertNotEqual(printer.config, conf)
-        printer.config = conf
-        self.assertEqual(printer.config, conf)
-
-class TestGutenbachPrinter(unittest.TestCase):
-
-    testJobName = "unique_test_job"
-    testJobRequestingUserName = "unique_test_username"
-    testPrinterConfig = {
-        'ipp-versions': ["1.0", "1.1"],
-        'dryrun': True
-        }
-
-    def setUp(self):
-        self.printer = GutenbachPrinter("test", self.testPrinterConfig)
-        self.printer.start()
-        while not self.printer.is_running:
-            time.sleep(0.01)
-
-    def tearDown(self):
-        self.printer.stop()
-
-    def createTestJob(self):
-        job_id = self.printer.create_job(
-            self.testJobRequestingUserName,
-            self.testJobName)
-        return job_id
-
-    def testPrintJob(self):
-        pass
-
-    def testValidateJob(self):
-        pass
-
-    def testGetJobs(self):
-        pass
-
-    def testPrintUri(self):
-        pass
-
-    def testCreateJob(self):
-        for i in xrange(2):
-            countBeforeAdded = len(self.printer.jobs)
-            job = self.createTestJob()
-            self.assertEqual(len(self.printer.jobs) - 1, countBeforeAdded)
-            self.printer.send_document(job, make_tempfile())
-            self.assertTrue(job in self.printer.pending_jobs)
-            self.assertFalse(job in self.printer.finished_jobs)
-            self.assertEqual(self.printer.state, States.PROCESSING)
-
-        while len(self.printer.active_jobs) > 0:
-            time.sleep(0.01)
-        self.assertEqual(self.printer.state, States.IDLE)
-
-    def testPausePrinter(self):
-        job = self.createTestJob()
-        self.printer.send_document(job, make_tempfile())
-        job = self.createTestJob()
-        self.printer.send_document(job, make_tempfile())
-        self.assertTrue(self.printer.is_running)
-        self.assertEqual(self.printer.state, States.PROCESSING)
-        self.assertFalse(self.printer.paused)
-
-        while self.printer.current_job is None:
-            time.sleep(0.01)
-
-        self.printer.pause_printer()
-        self.assertTrue(self.printer.paused)
-        time.sleep(0.6)
-        self.assertTrue(self.printer.current_job is not None)
-        self.assertEqual(self.printer.state, States.STOPPED)
-
-        # check that no jobs are playing
-        for job_id, job in self.printer.jobs.items():
-            self.assertEqual(job.is_paused, job.is_playing)
-
-    def testResumePrinter(self):
-        job = self.createTestJob()
-        self.printer.send_document(job, make_tempfile())
-        job = self.createTestJob()
-        self.printer.send_document(job, make_tempfile())
-        self.assertTrue(self.printer.is_running)
-        self.assertEqual(self.printer.state, States.PROCESSING)
-        self.assertFalse(self.printer.paused)
-
-        while self.printer.current_job is None:
-            time.sleep(0.01)
-
-        self.printer.pause_printer()
-        self.assertTrue(self.printer.paused)
-        time.sleep(0.6)
-        self.assertTrue(self.printer.current_job is not None)
-        self.assertEqual(self.printer.state, States.STOPPED)
-
-        # check that no jobs are playing
-        for job_id, job in self.printer.jobs.items():
-            self.assertEqual(job.is_paused, job.is_playing)
-
-        self.printer.resume_printer()
-        self.assertFalse(self.printer.paused)
-        self.assertEqual(self.printer.state, States.PROCESSING)
-
-        while len(self.printer.active_jobs) > 0:
-            time.sleep(0.01)
-        self.assertEqual(self.printer.state, States.IDLE)
-
-    def testGetPrinterAttributes(self):
-        pass
-
-    def testSetPrinterAttributes(self):
-        pass
-
-    def testCancelJob(self):
-        pass
-
-    def testSendDocument(self):
-        pass
-
-    def testSendUri(self):
-        pass
-
-    def testGetJobAttributes(self):
-        pass
-
-    def testSetJobAttributes(self):
-        pass
-
-    def testRestartJob(self):
-        pass
-
-    def testPromoteJob(self):
-        pass
-
-if __name__ == "__main__":
-    logging.basicConfig(loglevel=logging.DEBUG)
-    unittest.main()
