From 456a72762dba322282be49fbb7c6ef522cacb369 Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Sun, 14 Jan 2007 16:56:23 +1100 Subject: Add sibpath --- python/subunit/tests/test_test_protocol.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python/subunit/tests') diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index 2530f25..e6d6f0d 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -19,6 +19,7 @@ import unittest from StringIO import StringIO +import os import subunit import sys @@ -593,6 +594,11 @@ class TestExecTestCase(unittest.TestCase): def test_count_test_cases(self): """TODO run the child process and count responses to determine the count.""" + def test_sibpath(self): + sibling = subunit.sibpath(__file__, 'foo') + expected = '%s/foo' % (os.path.split(__file__)[0],) + self.assertEqual(sibling, expected) + class DoExecTestCase(subunit.ExecTestCase): -- cgit v1.2.1 From 501ba57871b35bab0bce1da4b72f7990a4f9dc14 Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Sun, 14 Jan 2007 17:02:10 +1100 Subject: Make ExecTestCase test docstring/paths relative to the module they are defined in. --- python/subunit/tests/test_test_protocol.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'python/subunit/tests') diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index e6d6f0d..4cd693d 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -562,14 +562,15 @@ class TestExecTestCase(unittest.TestCase): class SampleExecTestCase(subunit.ExecTestCase): def test_sample_method(self): - """./python/subunit/tests/sample-script.py""" + """sample-script.py""" # the sample script runs three tests, one each # that fails, errors and succeeds def test_construct(self): test = self.SampleExecTestCase("test_sample_method") - self.assertEqual(test.script, "./python/subunit/tests/sample-script.py") + self.assertEqual(test.script, + subunit.sibpath(__file__, 'sample-script.py')) def test_run(self): runner = MockTestProtocolServerClient() @@ -603,7 +604,7 @@ class TestExecTestCase(unittest.TestCase): class DoExecTestCase(subunit.ExecTestCase): def test_working_script(self): - """./python/subunit/tests/sample-two-script.py""" + """sample-two-script.py""" class TestIsolatedTestCase(unittest.TestCase): -- cgit v1.2.1 From cb1a0a2e928473ea68649c09b3691886ac93b57a Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Sun, 14 Jan 2007 17:33:52 +1100 Subject: Rename sibpath to join_dir, and add a docstring. --- python/subunit/tests/test_test_protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/subunit/tests') diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index 4cd693d..1ee4886 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -570,7 +570,7 @@ class TestExecTestCase(unittest.TestCase): def test_construct(self): test = self.SampleExecTestCase("test_sample_method") self.assertEqual(test.script, - subunit.sibpath(__file__, 'sample-script.py')) + subunit.join_dir(__file__, 'sample-script.py')) def test_run(self): runner = MockTestProtocolServerClient() -- cgit v1.2.1