Initial import to Tizen
[profile/ivi/python-twisted.git] / twisted / words / test / test_oscar.py
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 """
5 Tests for L{twisted.words.protocols.oscar}.
6 """
7
8 from twisted.trial.unittest import TestCase
9
10 from twisted.words.protocols.oscar import encryptPasswordMD5
11
12
13 class PasswordTests(TestCase):
14     """
15     Tests for L{encryptPasswordMD5}.
16     """
17     def test_encryptPasswordMD5(self):
18         """
19         L{encryptPasswordMD5} hashes the given password and key and returns a
20         string suitable to use to authenticate against an OSCAR server.
21         """
22         self.assertEqual(
23             encryptPasswordMD5('foo', 'bar').encode('hex'),
24             'd73475c370a7b18c6c20386bcf1339f2')