[Pkg-cracklib-commits] [pkg-cracklib] 01/02: add debian/patches/improve_test_737040.patch to check for proper behavior of Python low level code
Jan Dittberner
jandd at moszumanska.debian.org
Sat Feb 1 20:11:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
jandd pushed a commit to branch master
in repository pkg-cracklib.
commit 0a6bee989574e041c65fa0562946c8935e5baae2
Author: Jan Dittberner <jandd at debian.org>
Date: Sat Feb 1 19:06:00 2014 +0100
add debian/patches/improve_test_737040.patch to check for proper behavior of Python low level code
---
debian/changelog | 2 +
debian/patches/improve_test_737040.patch | 83 ++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 86 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index bed870a..2a7ff9f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ cracklib2 (2.9.1-1) UNRELEASED; urgency=medium
* debian/control:
- bump Standards-Version to 3.9.5 (No changes)
- run wrap-and-sort
+ * add debian/patches/improve_test_737040.patch to check for proper behavior
+ of Python low level code
-- Jan Dittberner <jandd at debian.org> Sat, 01 Feb 2014 15:58:15 +0100
diff --git a/debian/patches/improve_test_737040.patch b/debian/patches/improve_test_737040.patch
new file mode 100644
index 0000000..d9805c7
--- /dev/null
+++ b/debian/patches/improve_test_737040.patch
@@ -0,0 +1,83 @@
+Author: Jan Dittberner <jandd at debian.org>
+Subject: improve Python test to cover low level FascistCheck
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737040
+--- a/python/test_cracklib.py
++++ b/python/test_cracklib.py
+@@ -15,6 +15,13 @@
+
+
+ class TestModuleFunctions(unittest.TestCase):
++ def test_FascistCheck(self):
++ try:
++ cracklib.FascistCheck('test', dictpath=dictpath)
++ self.fail('expected ValueError')
++ except ValueError:
++ pass
++
+ def test_VeryFascistCheck(self):
+ try:
+ cracklib.VeryFascistCheck('test', dictpath=dictpath)
+@@ -68,7 +75,7 @@
+
+ def test_simple_lower(self):
+ for passwd in ['t' * i for i in range(
+- cracklib.MIN_LENGTH - cracklib.LOW_CREDIT)]:
++ cracklib.MIN_LENGTH - cracklib.LOW_CREDIT)]:
+ self.assertEquals(
+ 1, cracklib.simple(passwd),
+ 'password {0} should be detected as too simple'.format(
+@@ -78,7 +85,7 @@
+
+ def test_simple_upper(self):
+ for passwd in ['T' * i for i in range(
+- cracklib.MIN_LENGTH - cracklib.UP_CREDIT)]:
++ cracklib.MIN_LENGTH - cracklib.UP_CREDIT)]:
+ self.assertEquals(
+ 1, cracklib.simple(passwd),
+ 'password {0} should be detected as too simple'.format(
+@@ -88,7 +95,7 @@
+
+ def test_simple_digit(self):
+ for passwd in ['1' * i for i in range(
+- cracklib.MIN_LENGTH - cracklib.DIG_CREDIT)]:
++ cracklib.MIN_LENGTH - cracklib.DIG_CREDIT)]:
+ self.assertEquals(
+ 1, cracklib.simple(passwd),
+ 'password {0} should be detected as too simple'.format(
+@@ -98,7 +105,7 @@
+
+ def test_simple_other(self):
+ for passwd in ['#' * i for i in range(
+- cracklib.MIN_LENGTH - cracklib.OTH_CREDIT)]:
++ cracklib.MIN_LENGTH - cracklib.OTH_CREDIT)]:
+ self.assertEquals(
+ 1, cracklib.simple(passwd),
+ 'password {0} should be detected as too simple'.format(
+@@ -109,14 +116,16 @@
+ def test_simple_combinations(self):
+ testset = '#a' * (cracklib.MIN_LENGTH // 2)
+ for passwd in [testset[:i] for i in range(
+- cracklib.MIN_LENGTH - cracklib.LOW_CREDIT - cracklib.OTH_CREDIT)]:
++ cracklib.MIN_LENGTH -
++ cracklib.LOW_CREDIT -
++ cracklib.OTH_CREDIT)]:
+ self.assertEquals(
+ 1, cracklib.simple(passwd),
+ 'password {0} should be detected as too simple'.format(
+ passwd))
+ self.assertEquals(0, cracklib.simple(
+ testset[:(cracklib.MIN_LENGTH - cracklib.LOW_CREDIT -
+- cracklib.OTH_CREDIT)]))
++ cracklib.OTH_CREDIT)]))
+
+
+ tests.append(TestModuleFunctions)
+@@ -127,7 +136,7 @@
+ print(('cracklib is installed in: ' + os.path.dirname(__file__)))
+ print(('cracklib version: ' + __version__))
+ print((sys.version))
+- dictpath=use_dictpath
++ dictpath = use_dictpath
+
+ suite = unittest.TestSuite()
+ for cls in tests:
diff --git a/debian/patches/series b/debian/patches/series
index e9a18db..d84a0e6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
install-debian-python-modules.patch
libcrack2-error-safer-check-variant.patch
+improve_test_737040.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cracklib/pkg-cracklib.git
More information about the Pkg-cracklib-commits
mailing list