changeset 597:c86e1f677ebc pytest2

added test for unexpected version string format in util/test_version.py
author pkumar <contactprashantat@gmail.com>
date Wed, 29 Jun 2011 01:07:58 +0530
parents 837d949a4539
children af0b6a1c3764
files MoinMoin/util/_tests/test_version.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/_tests/test_version.py	Tue Jun 28 19:43:06 2011 +0530
+++ b/MoinMoin/util/_tests/test_version.py	Wed Jun 29 01:07:58 2011 +0530
@@ -7,7 +7,7 @@
 
 
 from MoinMoin.util.version import Version
-
+import pytest
 
 class TestVersion(object):
     def test_Version(self):
@@ -53,6 +53,9 @@
         assert Version(1, 2, 3, 'c99') < (1, 2, 4)
         assert Version(1, 2, 4) > (1, 2, 3)
         assert Version(1, 2, 4) > (1, 2, 3, 'c99')
+        # test wrong version string format
+        with pytest.raises(ValueError):
+            assert str(Version(version='wrong_value'))
 
 
 coverage_modules = ['MoinMoin.util.version']