summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-06 14:08:39 +0100
committerhut <hut@lavabit.com>2009-12-06 14:08:39 +0100
commit373fdb3b29eeda84beef7f4096e523919ae9b3cb (patch)
tree1d7b4c2e7926daf357775655188c3c6c35fe133a
parent65cb1a32d4d5f83f48169846afec201ab3b6f9c3 (diff)
downloadranger-373fdb3b29eeda84beef7f4096e523919ae9b3cb.tar.gz
fixed directory test
-rw-r--r--ranger/directory.py4
-rw-r--r--test/tc_directory.py19
2 files changed, 2 insertions, 21 deletions
diff --git a/ranger/directory.py b/ranger/directory.py
index 113cf792..6a619537 100644
--- a/ranger/directory.py
+++ b/ranger/directory.py
@@ -17,9 +17,9 @@ class NoDirectoryGiven(Exception):
 
 class Directory(SuperClass, SettingsAware):
 	def __init__(self, path):
-		from os.path import isdir
+		from os.path import isfile
 
-		if not isdir(path):
+		if isfile(path):
 			raise NoDirectoryGiven()
 
 		SuperClass.__init__(self, path)
diff --git a/test/tc_directory.py b/test/tc_directory.py
index c2129a29..7faeb7d2 100644
--- a/test/tc_directory.py
+++ b/test/tc_directory.py
@@ -66,25 +66,6 @@ class Test1(unittest.TestCase):
 		self.assertRaises(fsobject.NotLoadedYet, len, dir)
 		self.assertRaises(fsobject.NotLoadedYet, dir.__getitem__, 0)
 
-	# This test is obsolete!
-#	def test_modify_frozen_clone(self):
-#		dir = Directory(TESTDIR)
-#		clone = dir.frozen_clone()
-#
-#		# assert that their attributes are equal, except for frozen, which
-#		# should be true for the clone.
-#		self.assertTrue(clone.frozen)
-#		clone.frozen = False
-#		self.assertEqual(dir.__dict__, clone.__dict__)
-#		clone.frozen = True
-#
-#		# check for inequality after loading filenames with one object
-#		self.assertEqual(dir.filenames, clone.filenames)
-#		dir.load_content()
-#		self.assertNotEqual(dir.filenames, clone.filenames)
-#
-#		self.assertRaises(fsobject.FrozenException, clone.load_content)
-
 	def test_load_if_outdated(self):
 		import os
 		import time
;vc@akkartik.com> 2016-12-26 01:17:01 -0800 committer Kartik K. Agaram <vc@akkartik.com> 2016-12-26 01:26:16 -0800 3709 - line numbers in html' href='/akkartik/mu/commit/html/068random.mu.html?h=hlt&id=e5c11a5137d538b7713dd8708ca767c208824c06'>e5c11a51 ^
9e751bb8 ^
4a39d12d ^
c842d90b ^





e5c11a51 ^






















c842d90b ^


e5c11a51 ^
c842d90b ^
6c52e24e ^
204dae92 ^


9e751bb8 ^



204dae92 ^




6c52e24e ^
204dae92 ^




9e751bb8 ^



204dae92 ^




9e751bb8 ^




204dae92 ^
201458e3 ^
204dae92 ^



6c52e24e ^




204dae92 ^
9e751bb8 ^







204dae92 ^


bd58d18a ^
6c52e24e ^
bd58d18a ^










6c52e24e ^

bd58d18a ^



c842d90b ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140