[Pkg-cracklib-commits] [pkg-cracklib] 02/06: remove debian/test_cracklib.py that is now included as python/test_cracklib.py
Jan Dittberner
jandd at moszumanska.debian.org
Sun Oct 5 22:01:26 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 13bb82c18f8b3b5231a57532aec1a8acbd797575
Author: Jan Dittberner <jandd at debian.org>
Date: Sun Oct 5 22:48:00 2014 +0200
remove debian/test_cracklib.py that is now included as python/test_cracklib.py
---
debian/changelog | 2 +
debian/test_cracklib.py | 137 ------------------------------------------------
2 files changed, 2 insertions(+), 137 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 3ad91c6..931ad51 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ cracklib2 (2.9.2-1) UNRELEASED; urgency=medium
* bump Standards-Version to 3.9.6 (No changes)
* upstream supports out of tree builds, simplify debian/rules
override_dh_auto_build and override_dh_auto_clean
+ * remove debian/test_cracklib.py that is now included as
+ python/test_cracklib.py
-- Jan Dittberner <jandd at debian.org> Sun, 05 Oct 2014 20:03:52 +0200
diff --git a/debian/test_cracklib.py b/debian/test_cracklib.py
deleted file mode 100644
index cd20c90..0000000
--- a/debian/test_cracklib.py
+++ /dev/null
@@ -1,137 +0,0 @@
-# -*- python -*-
-# -*- coding: utf-8 -*-
-"""
-Test suite for cracklib's Python binding.
-"""
-import os
-import sys
-import unittest
-import cracklib
-
-__version__ = '2.8.19'
-
-tests = []
-dictpath = None
-
-
-class TestModuleFunctions(unittest.TestCase):
- def test_VeryFascistCheck(self):
- try:
- cracklib.VeryFascistCheck('test', dictpath=dictpath)
- self.fail('expected ValueError')
- except ValueError:
- pass
- try:
- cracklib.VeryFascistCheck('LhIRI6JXpKhUqBjT', dictpath=dictpath)
- except ValueError:
- self.fail('password should be good enough')
-
- def test_palindrome(self):
- try:
- cracklib.VeryFascistCheck('ot23#xyx#32to', dictpath=dictpath)
- self.fail('expected ValueError')
- except ValueError:
- e = sys.exc_info()[1]
- self.assertEqual('is a palindrome', str(e))
-
- def test_same(self):
- try:
- cracklib.VeryFascistCheck('test', 'test', dictpath=dictpath)
- self.fail('expected ValueError')
- except ValueError:
- e = sys.exc_info()[1]
- self.assertEqual('is the same as the old one', str(e))
-
- def test_case_change(self):
- try:
- cracklib.VeryFascistCheck('test', 'TeSt', dictpath=dictpath)
- self.fail('expected ValueError')
- except ValueError:
- e = sys.exc_info()[1]
- self.assertEqual('case changes only', str(e))
-
- def test_similar(self):
- try:
- cracklib.VeryFascistCheck('test12', 'test34', dictpath=dictpath)
- self.fail('expected ValueError')
- except ValueError:
- e = sys.exc_info()[1]
- self.assertEqual('is too similar to the old one', str(e))
-
- def test_simple(self):
- try:
- cracklib.VeryFascistCheck('t3sx24', dictpath=dictpath)
- self.fail('expected ValueError')
- except ValueError:
- e = sys.exc_info()[1]
- self.assertEqual('is too simple', str(e))
-
- def test_simple_lower(self):
- for passwd in ['t' * i for i in range(
- cracklib.MIN_LENGTH - cracklib.LOW_CREDIT)]:
- self.assertEquals(
- 1, cracklib.simple(passwd),
- 'password {0} should be detected as too simple'.format(
- passwd))
- self.assertEquals(0, cracklib.simple(
- 't' * (cracklib.MIN_LENGTH - cracklib.LOW_CREDIT)))
-
- def test_simple_upper(self):
- for passwd in ['T' * i for i in range(
- cracklib.MIN_LENGTH - cracklib.UP_CREDIT)]:
- self.assertEquals(
- 1, cracklib.simple(passwd),
- 'password {0} should be detected as too simple'.format(
- passwd))
- self.assertEquals(0, cracklib.simple(
- 'T' * (cracklib.MIN_LENGTH - cracklib.UP_CREDIT)))
-
- def test_simple_digit(self):
- for passwd in ['1' * i for i in range(
- cracklib.MIN_LENGTH - cracklib.DIG_CREDIT)]:
- self.assertEquals(
- 1, cracklib.simple(passwd),
- 'password {0} should be detected as too simple'.format(
- passwd))
- self.assertEquals(0, cracklib.simple(
- '1' * (cracklib.MIN_LENGTH - cracklib.DIG_CREDIT)))
-
- def test_simple_other(self):
- for passwd in ['#' * i for i in range(
- cracklib.MIN_LENGTH - cracklib.OTH_CREDIT)]:
- self.assertEquals(
- 1, cracklib.simple(passwd),
- 'password {0} should be detected as too simple'.format(
- passwd))
- self.assertEquals(0, cracklib.simple(
- '#' * (cracklib.MIN_LENGTH - cracklib.OTH_CREDIT)))
-
- 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)]:
- 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)]))
-
-
-tests.append(TestModuleFunctions)
-
-
-def run(verbosity=1, repeat=1, use_dictpath=None):
- global dictpath
- print(('cracklib is installed in: ' + os.path.dirname(__file__)))
- print(('cracklib version: ' + __version__))
- print((sys.version))
- dictpath=use_dictpath
-
- suite = unittest.TestSuite()
- for cls in tests:
- for _ in range(repeat):
- suite.addTest(unittest.makeSuite(cls))
- runner = unittest.TextTestRunner(verbosity=verbosity)
- return runner.run(suite)
--
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