Rev 9: Merge Jelmer's tests in http://bzr.arbash-meinel.com/plugins/stats

John Arbash Meinel john at arbash-meinel.com
Tue Jul 17 17:17:07 BST 2007


At http://bzr.arbash-meinel.com/plugins/stats

------------------------------------------------------------
revno: 9
revision-id: john at arbash-meinel.com-20070717161704-86awwl7ho2wur2zq
parent: john at arbash-meinel.com-20060828171427-ca9af8eece84b7e8
parent: jelmer at samba.org-20070717155953-gqygvf84b0zi1jtv
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: stats
timestamp: Tue 2007-07-17 11:17:04 -0500
message:
  Merge Jelmer's tests
added:
  test_stats.py                  test_stats.py-20070717155624-qo704ytybw1z302x-1
modified:
  __init__.py                    __init__.py-20060629132721-mkbaty0vfk4y3v59-1
    ------------------------------------------------------------
    revno: 8.1.1
    revision-id: jelmer at samba.org-20070717155953-gqygvf84b0zi1jtv
    parent: john at arbash-meinel.com-20060828171427-ca9af8eece84b7e8
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Tue 2007-07-17 17:59:53 +0200
    message:
      Add some simple tests for extract_fullname.
    added:
      test_stats.py                  test_stats.py-20070717155624-qo704ytybw1z302x-1
    modified:
      __init__.py                    __init__.py-20060629132721-mkbaty0vfk4y3v59-1
-------------- next part --------------
=== added file 'test_stats.py'
--- a/test_stats.py	1970-01-01 00:00:00 +0000
+++ b/test_stats.py	2007-07-17 15:59:53 +0000
@@ -0,0 +1,16 @@
+from bzrlib.tests import TestCase
+from bzrlib.plugins.stats import extract_fullname
+
+class TestFullnameExtractor(TestCase):
+    def test_standard(self):
+        self.assertEquals("John Doe", 
+            extract_fullname("John Doe <joe at example.com>"))
+
+    def test_only_email(self):
+        self.assertEquals("",
+            extract_fullname("joe at example.com"))
+
+    def test_only_fullname(self):
+        self.assertEquals("John Doe",
+            extract_fullname("John Doe"))
+

=== modified file '__init__.py'
--- a/__init__.py	2006-08-28 17:14:27 +0000
+++ b/__init__.py	2007-07-17 15:59:53 +0000
@@ -248,3 +248,14 @@
 
 
 bzrlib.commands.register_command(cmd_ancestor_growth)
+
+def test_suite():
+    from unittest import TestSuite
+    from bzrlib.tests import TestLoader
+    import test_stats
+    suite = TestSuite()
+    loader = TestLoader()
+    testmod_names = ['test_stats']
+    suite.addTest(loader.loadTestsFromModuleNames(['%s.%s' % (__name__, i) for i in testmod_names]))
+    return suite
+



More information about the bazaar-commits mailing list