diff options
author | Heikki Toivonen <heikki@heikkitoivonen.net> | 2006-12-15 00:17:00 +0000 |
---|---|---|
committer | Heikki Toivonen <heikki@heikkitoivonen.net> | 2006-12-15 00:17:00 +0000 |
commit | cc79fc74eb80257d67837c0ea54e60efa32b7eaf (patch) | |
tree | c9a06a9a42e2e80144ce1a7e200b7e054773ce0c /tests/test_authcookie.py | |
parent | 381167f5d6add76b9461c30d2dabf156e3ff3f04 (diff) | |
download | m2crypto-cc79fc74eb80257d67837c0ea54e60efa32b7eaf.tar.gz |
Make all test methods start with test_, so that running individual suites works,
for example:
python setup.py test --test-suite=tests.test_x509 -q
git-svn-id: http://svn.osafoundation.org/m2crypto/trunk@504 2715db39-9adf-0310-9c64-84f055769b4b
Diffstat (limited to 'tests/test_authcookie.py')
-rw-r--r-- | tests/test_authcookie.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tests/test_authcookie.py b/tests/test_authcookie.py index 6352d88..9ce0eb8 100644 --- a/tests/test_authcookie.py +++ b/tests/test_authcookie.py @@ -23,13 +23,13 @@ class AuthCookieTestCase(unittest.TestCase): def tearDown(self): pass - def check_mix_unmix(self): + def test_mix_unmix(self): dough = mix(self.exp, self.data) exp, data = unmix(dough) self.failUnlessEqual(data, self.data) self.failUnlessEqual(exp, self.exp) - def check_make_cookie(self): + def test_make_cookie(self): c = self.jar.makeCookie(self.exp, self.data) self.failUnless(isinstance(c, AuthCookie)) self.failUnlessEqual(c.expiry(), self.exp) @@ -42,40 +42,40 @@ class AuthCookieTestCase(unittest.TestCase): cookie_str = self._format % (repr(self.exp), self.data, mac) self.failUnlessEqual(c.output(), cookie_str) - def check_expired(self): + def test_expired(self): t = self.exp - 7200 c = self.jar.makeCookie(t, self.data) self.failUnless(c.isExpired()) - def check_not_expired(self): + def test_not_expired(self): c = self.jar.makeCookie(self.exp, self.data) self.failIf(c.isExpired()) - def check_is_valid(self): + def test_is_valid(self): c = self.jar.makeCookie(self.exp, self.data) self.failUnless(self.jar.isGoodCookie(c)) - def check_is_invalid_expired(self): + def test_is_invalid_expired(self): t = self.exp - 7200 c = self.jar.makeCookie(t, self.data) self.failIf(self.jar.isGoodCookie(c)) - def check_is_invalid_changed_exp(self): + def test_is_invalid_changed_exp(self): c = self.jar.makeCookie(self.exp, self.data) c._expiry = 'this is bad' self.failIf(self.jar.isGoodCookie(c)) - def check_is_invalid_changed_data(self): + def test_is_invalid_changed_data(self): c = self.jar.makeCookie(self.exp, self.data) c._data = 'this is bad' self.failIf(self.jar.isGoodCookie(c)) - def check_is_invalid_changed_mac(self): + def test_is_invalid_changed_mac(self): c = self.jar.makeCookie(self.exp, self.data) c._mac = 'this is bad' self.failIf(self.jar.isGoodCookie(c)) - def check_mix_unmix3(self): + def test_mix_unmix3(self): c = self.jar.makeCookie(self.exp, self.data) s = Cookie.SmartCookie() s.load(c.output()) @@ -86,24 +86,24 @@ class AuthCookieTestCase(unittest.TestCase): mac = binascii.b2a_base64(EVP.hmac(key, mix(self.exp, self.data), 'sha1'))[:-1] self.failUnlessEqual(digest, mac) - def check_cookie_str(self): + def test_cookie_str(self): c = self.jar.makeCookie(self.exp, self.data) self.failUnless(self.jar.isGoodCookieString(c.output())) - def check_cookie_str2(self): + def test_cookie_str2(self): c = self.jar.makeCookie(self.exp, self.data) s = Cookie.SmartCookie() s.load(c.output()) self.failUnless(self.jar.isGoodCookieString(s.output())) - def check_cookie_str_expired(self): + def test_cookie_str_expired(self): t = self.exp - 7200 c = self.jar.makeCookie(t, self.data) s = Cookie.SmartCookie() s.load(c.output()) self.failIf(self.jar.isGoodCookieString(s.output())) - def check_cookie_str_arbitrary_change(self): + def test_cookie_str_arbitrary_change(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output() str = cout[:32] + 'this is bad' + cout[32:] @@ -111,7 +111,7 @@ class AuthCookieTestCase(unittest.TestCase): s.load(str) self.failIf(self.jar.isGoodCookieString(s.output())) - def check_cookie_str_changed_exp(self): + def test_cookie_str_changed_exp(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output() str = cout[:26] + '2' + cout[27:] @@ -119,7 +119,7 @@ class AuthCookieTestCase(unittest.TestCase): s.load(str) self.failIf(self.jar.isGoodCookieString(s.output())) - def check_cookie_str_changed_data(self): + def test_cookie_str_changed_data(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output() str = cout[:36] + 'X' + cout[37:] @@ -127,7 +127,7 @@ class AuthCookieTestCase(unittest.TestCase): s.load(str) self.failIf(self.jar.isGoodCookieString(s.output())) - def check_cookie_str_changed_mac(self): + def test_cookie_str_changed_mac(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output() str = cout[:76] + 'X' + cout[77:] @@ -137,7 +137,7 @@ class AuthCookieTestCase(unittest.TestCase): def suite(): - return unittest.makeSuite(AuthCookieTestCase, 'check_') + return unittest.makeSuite(AuthCookieTestCase) if __name__ == '__main__': |