summary refs log tree commit diff stats
path: root/test/dirsize_benchmark.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-11 13:36:48 +0100
committerhut <hut@lavabit.com>2009-12-11 13:36:48 +0100
commitf58626842bbb2bd3f8446044a44a67180b737f4e (patch)
tree74ab897879a3b151488c8348759442396ef3336b /test/dirsize_benchmark.py
parent0c0b9489072922c0f597c7099f8728868ffbb4a4 (diff)
downloadranger-f58626842bbb2bd3f8446044a44a67180b737f4e.tar.gz
moved/fixed tests
Diffstat (limited to 'test/dirsize_benchmark.py')
-rw-r--r--test/dirsize_benchmark.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/test/dirsize_benchmark.py b/test/dirsize_benchmark.py
deleted file mode 100644
index 5784ee80..00000000
--- a/test/dirsize_benchmark.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import os, time
-class Dirsize():
-	def a(path):
-		return len(os.listdir(path))
-
-	def b(path):
-		for _, dirs, files in os.walk(path):
-			return len(files) + len(dirs)
-
-	def c(path):
-		first = next(os.walk(path))
-		return len(first[1]) + len(first[2])
-
-paths = {
-		'/usr/lib': None,
-		'/usr/bin': None,
-		'/home/hut': None
-}
-
-for key in paths.keys():
-	paths[key] = Dirsize.a(key) # assume Dirsize.a() returns a correct result
-	for algo in ['a', 'b', 'c']:
-		t = time.time()
-		for i in range(4):
-			assert Dirsize.__dict__[algo](key) == paths[key]
-		print("algorithm %s: %20s: %f" % (algo, key, time.time() - t))
-
-# a !!