Permalink
Browse files

Small bug fix to test code. Updated setup script to list PyLRU as v1.0

  • Loading branch information...
1 parent 15b4d1a commit 8d09ccde0b2743c666d8b4eafa6ae306a785baea @jlhutch committed Sep 16, 2010
Showing with 12 additions and 12 deletions.
  1. +1 −0 MANIFEST.in
  2. +2 −2 setup.py
  3. +9 −10 test.py
View
@@ -1 +1,2 @@
include LICENSE.txt
+include test.py
View
@@ -2,7 +2,7 @@
setup(
name = "pylru",
- version = "0.9.1",
+ version = "1.0.0",
py_modules=['pylru'],
description = "A least recently used (LRU) cache implementation",
author = "Jay Hutchinson",
@@ -12,7 +12,7 @@
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: OS Independent",
View
@@ -2,7 +2,6 @@
from pylru import *
import random
-
class simplelrucache:
def __init__(self, size):
@@ -29,7 +28,7 @@ def __getitem__(self, key):
self.cache.append(x)
return x[1]
- assert False
+ raise KeyError
def __setitem__(self, key, obj):
@@ -47,16 +46,15 @@ def __setitem__(self, key, obj):
self.cache.append([key, obj])
- return
-
+
def __delitem__(self, key):
for i in range(len(self.cache)):
if self.cache[i][0] == key:
del self.cache[i]
return
- return
+ raise KeyError
def test(a, b, c, d, verify):
@@ -164,11 +162,12 @@ def testDecorator():
random.seed()
- testcache()
- wraptest()
- wraptest2()
- wraptest3()
- testDecorator()
+ for i in range(20):
+ testcache()
+ wraptest()
+ wraptest2()
+ wraptest3()
+ testDecorator()

0 comments on commit 8d09ccd

Please sign in to comment.