- Timestamp:
- 04/13/08 18:10:28 (7 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
CHANGES.txt (modified) (1 diff)
-
LICENSE.txt (modified) (1 diff)
-
README.txt (modified) (2 diffs)
-
pyrad/tests/testTools.py (modified) (2 diffs)
-
pyrad/tools.py (modified) (2 diffs)
-
setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGES.txt
r1129 r2160 1 1 Pyrad 1.2 (unreleased) 2 2 ====================== 3 4 * Make sure all encoding utility methods raise a TypeError if a value of 5 the wrong type is passed in. 3 6 4 7 -
trunk/LICENSE.txt
r1024 r2160 1 Copyright 2002-200 7Wichert Akkerman. All rights reserved.2 Copyright 2007 Simplon. All rights reserved.1 Copyright 2002-2008 Wichert Akkerman. All rights reserved. 2 Copyright 2007-2008 Simplon. All rights reserved. 3 3 4 4 All rights reserved. -
trunk/README.txt
r1085 r2160 44 44 =============================== 45 45 46 pyrad was written by Wichert Akkerman <wichert@wiggy.net> 46 pyrad was written by Wichert Akkerman <wichert@wiggy.net> and is licensed 47 under a BSD license. 47 48 48 Copyright and license information can be found in LICENSE.txt49 Copyright and license information can be found in the LICENSE.txt file. 49 50 50 51 The current version and documentation can be found at its homepage: … … 54 55 https://code.wiggy.net/tracker/pyrad/ 55 56 56 -
trunk/pyrad/tests/testTools.py
r1128 r2160 8 8 9 9 10 def testInvalidStringEncodingRaisesTypeError(self): 11 self.assertRaises(TypeError, tools.EncodeString, 1) 12 13 10 14 def testAddressEncoding(self): 11 15 self.assertRaises(ValueError, tools.EncodeAddress, "123") 12 16 self.assertEqual(tools.EncodeAddress("192.168.0.255"), 13 17 "\xc0\xa8\x00\xff") 18 19 20 def testInvalidAddressEncodingRaisesTypeError(self): 21 self.assertRaises(TypeError, tools.EncodeAddress, 1) 14 22 15 23 … … 19 27 20 28 29 def testInvalidIntegerEncodingRaisesTypeError(self): 30 self.assertRaises(TypeError, tools.EncodeInteger, "1") 31 32 21 33 def testDateEncoding(self): 22 34 self.assertEqual(tools.EncodeDate(0x01020304), 23 35 "\x01\x02\x03\x04") 36 37 38 def testInvalidDataEncodingRaisesTypeError(self): 39 self.assertRaises(TypeError, tools.EncodeDate, "1") 24 40 25 41 -
trunk/pyrad/tools.py
r1128 r2160 14 14 15 15 def EncodeAddress(addr): 16 if not isinstance(addr, basestring): 17 raise TypeError, "Address has to be a string" 16 18 (a,b,c,d)=map(int, addr.split(".")) 17 19 return struct.pack("BBBB", a, b, c, d) … … 19 21 20 22 def EncodeInteger(num): 23 if not isinstance(num, int): 24 raise TypeError, "Can not encode non-integer as integer" 21 25 return struct.pack("!I", num) 22 26 23 27 24 28 def EncodeDate(num): 29 if not isinstance(num, int): 30 raise TypeError, "Can not encode non-integer as date" 25 31 return struct.pack("!I", num) 26 32 -
trunk/setup.py
r1129 r2160 12 12 license = "BSD", 13 13 description = "RADIUS client tools", 14 long_description= open("README.txt").read()+open("CHANGES.txt").read(), 14 long_description= open("README.txt").read() + "\n" + 15 open("CHANGES.txt").read(), 15 16 classifiers = [ 16 17 "Intended Audience :: Developers",