summaryrefslogtreecommitdiff
path: root/unit_tests
diff options
context:
space:
mode:
authorkumar <kumar.mcmillan@gmail.com>2011-06-17 13:44:41 -0500
committerkumar <kumar.mcmillan@gmail.com>2011-06-17 13:44:41 -0500
commit9983772e6349c977a14a82ccbf63353c976b56a1 (patch)
tree0083a70e2c1e061d03b86426f5fc03f596f1a592 /unit_tests
parentc959660d14ec29002aa02733a92e1809b25ba3db (diff)
downloadnose-9983772e6349c977a14a82ccbf63353c976b56a1.tar.gz
Fixes Xunit so it represents generator test names correctly (Issue 369)
Diffstat (limited to 'unit_tests')
-rw-r--r--unit_tests/test_xunit.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/unit_tests/test_xunit.py b/unit_tests/test_xunit.py
index f748927..3ee7101 100644
--- a/unit_tests/test_xunit.py
+++ b/unit_tests/test_xunit.py
@@ -8,7 +8,7 @@ from xml.sax import saxutils
from nose.pyversion import UNICODE_STRINGS
from nose.tools import eq_
-from nose.plugins.xunit import Xunit, escape_cdata
+from nose.plugins.xunit import Xunit, escape_cdata, id_split
from nose.exc import SkipTest
from nose.config import Config
@@ -58,6 +58,26 @@ class TestEscaping(unittest.TestCase):
eq_(self.x._quoteattr('foo\n\b\f\r'), '"foo%s??%s"' % (n, r))
eq_(escape_cdata('foo\n\b\f\r'), 'foo\n??\r')
+class TestSplitId(unittest.TestCase):
+
+ def check_id_split(self, cls, name):
+ split = id_split('%s.%s' % (cls, name))
+ eq_(split[0], cls)
+ eq_(split[1], name)
+
+ def test_no_parenthesis(self):
+ self.check_id_split("test_parset", "test_args")
+
+ def test_no_dot_in_args(self):
+ self.check_id_split("test_parset", "test_args(('x', [1, 2]),)")
+
+ def test_dot_in_args(self):
+ self.check_id_split("test_parset", "test_args(('x.y', 1),)")
+
+ def test_grandchild_has_dot_in_args(self):
+ self.check_id_split("test_grandparset.test_parset",
+ "test_args(('x.y', 1),)")
+
class TestOptions(unittest.TestCase):
def test_defaults(self):