[py-svn] r10304 - py/branch/py-collect/test/tkinter

jan at codespeak.net jan at codespeak.net
Mon Apr 4 19:59:01 CEST 2005


Author: jan
Date: Mon Apr  4 19:59:01 2005
New Revision: 10304

Added:
   py/branch/py-collect/test/tkinter/test_util.py
      - copied, changed from r10300, py/branch/py-collect/test/tkinter/test_utils.py
Removed:
   py/branch/py-collect/test/tkinter/test_utils.py
Modified:
   py/branch/py-collect/test/tkinter/test_guidriver.py
   py/branch/py-collect/test/tkinter/tkgui.py
   py/branch/py-collect/test/tkinter/util.py
Log:
missed some references to utils.py


Modified: py/branch/py-collect/test/tkinter/test_guidriver.py
==============================================================================
--- py/branch/py-collect/test/tkinter/test_guidriver.py	(original)
+++ py/branch/py-collect/test/tkinter/test_guidriver.py	Mon Apr  4 19:59:01 2005
@@ -3,7 +3,7 @@
 import guidriver
 GuiDriver = guidriver.GuiDriver
 
-from utils import Status, TestReport, Null
+from util import Status, TestReport, Null
 
 class TestGuiDriver:
 

Copied: py/branch/py-collect/test/tkinter/test_util.py (from r10300, py/branch/py-collect/test/tkinter/test_utils.py)
==============================================================================
--- py/branch/py-collect/test/tkinter/test_utils.py	(original)
+++ py/branch/py-collect/test/tkinter/test_util.py	Mon Apr  4 19:59:01 2005
@@ -1,6 +1,6 @@
 
-import utils
-from utils import Status, TestReport, OutBuffer
+import util
+from util import Status, TestReport, OutBuffer
 import py
 Item = py.test.Item
 

Deleted: /py/branch/py-collect/test/tkinter/test_utils.py
==============================================================================
--- /py/branch/py-collect/test/tkinter/test_utils.py	Mon Apr  4 19:59:01 2005
+++ (empty file)
@@ -1,118 +0,0 @@
-
-import utils
-from utils import Status, TestReport, OutBuffer
-import py
-Item = py.test.Item
-
-class TestStatus:
-
-    def test_init_with_None(self):
-        status = Status(None)
-        assert status == status.NotExecuted()
-
-    def test_str(self):
-        status = Status(Item.Passed())
-        assert status == status.Passed()
-
-        status = Status(Item.Failed())
-        assert status == status.Failed()
-
-        status = Status(Item.Skipped())
-        assert status == status.Skipped()
-
-        status = Status(Item.ExceptionFailure())
-        assert status == status.ExceptionFailure()
-
-
-    def test_init_with_bad_name(self):
-        status = Status('nothing')
-        assert status == Status.NotExecuted()
-
-    def test_init_with_good_name(self):
-        def check_str(obj, expected):
-            assert str(obj) == expected
-            
-        for name in Status.ordered_list:
-            yield check_str, Status(name), name
-
-    def test_update(self):
-        failed = Status.Failed()
-        passed = Status.Passed()
-        failed.update(passed)
-        assert failed == Status.Failed()
-
-        passed.update(failed)
-        assert passed == Status.Failed()
-        assert passed == failed
-
-    def test_eq_(self):
-        passed = Status.Passed()
-        assert passed == passed
-        assert passed == Status.Passed()
-
-        failed = Status.Failed()
-        assert failed != passed
-
-
-class TestTestReport:
-
-    def setup_method(self, method):
-        self.path = py.path.local()
-        self.collector = py.test.Directory(self.path)
-        self.testresult = TestReport()
-        
-    def test_start(self):
-        self.testresult.start(self.collector)
-
-        assert self.testresult.full_id == self.collector.listnames()
-        assert self.testresult.time != 0
-        assert self.testresult.status == Status.NotExecuted()
-
-    def test_finish(self):
-        self.testresult.start(self.collector)
-
-        py.std.time.sleep(1.1)
-
-        self.testresult.finish(self.collector, None)
-        assert self.testresult.time > 1
-        assert self.testresult.status == Status.NotExecuted()
-
-##     def test_finish_failed(self):
-##         self.testresult.start(self.collector)
-
-##         self.testresult.finish(self.collector, py.test.Collector.Failed())
-##         assert self.testresult.status == Status.Failed()
-
-        
-        
-    def test_toChannel_fromChannel(self):
-        assert isinstance(self.testresult.toChannel()['status'], str)
-        result = TestReport.fromChannel(self.testresult.toChannel())
-        assert isinstance(result.status, Status)
-
-    def test_copy(self):
-        result2 = self.testresult.copy()
-        assert self.testresult.status == Status.NotExecuted()
-        for key in TestReport.template.keys():
-            assert getattr(result2, key) == getattr(self.testresult, key)
-
-        self.testresult.status = Status.Failed()
-        assert result2.status != self.testresult.status
-        
-            
-class Test_OutBuffer:
-
-    def setup_method(self, method):
-        self.out = OutBuffer()
-
-    def test_line(self):
-        oneline = 'oneline'
-        self.out.line(oneline)
-        assert self.out.getoutput() == oneline + '\n'
-
-    def test_write(self):
-        item = 'item'
-        self.out.write(item)
-        assert self.out.getoutput() == item
-
-    

Modified: py/branch/py-collect/test/tkinter/tkgui.py
==============================================================================
--- py/branch/py-collect/test/tkinter/tkgui.py	(original)
+++ py/branch/py-collect/test/tkinter/tkgui.py	Mon Apr  4 19:59:01 2005
@@ -15,8 +15,8 @@
 Collector = py.test.Collector
 
 import repository
-import utils
-from util import TestReport, Status, Null
+import util
+from util import TestReport, Status, Null, TestFileWatcher
 import gui
 
 
@@ -178,7 +178,7 @@
         self.reset_repository()
         self.args = py.std.sys.argv[1:]
         self.paths = py.test.config.init(self.args)[1]
-        self.testfilewatcher = utils.TestFileWatcher(*self.paths)
+        self.testfilewatcher = TestFileWatcher(*self.paths)
         # Create the queue
         self.guiqueue = Queue.Queue()
         self.reporterqueue = Queue.Queue()

Modified: py/branch/py-collect/test/tkinter/util.py
==============================================================================
--- py/branch/py-collect/test/tkinter/util.py	(original)
+++ py/branch/py-collect/test/tkinter/util.py	Mon Apr  4 19:59:01 2005
@@ -135,7 +135,7 @@
     def start(self, collector):
         self.full_id = collector.listnames()
         self.id = collector.name
-        if collector.getpathlineno(): # save for Null() in test_utils.py
+        if collector.getpathlineno(): # save for Null() in test_util.py
             fspath, lineno = collector.getpathlineno()
             if lineno != sys.maxint:
                 str_append = ' [%s:%s]' % (fspath.basename, lineno)
@@ -150,7 +150,7 @@
 
     def finish(self, collector, res, option = Null()):
         self.settime()
-        if collector.getpathlineno(): # save for Null() in test_utils.py
+        if collector.getpathlineno(): # save for Null() in test_util.py
             fspath, lineno = collector.getpathlineno()
             if lineno != sys.maxint:
                 str_append = ' [%s:%s] %0.2fsecs' % (fspath.basename, lineno, self.time)



More information about the pytest-commit mailing list