From 373fdb3b29eeda84beef7f4096e523919ae9b3cb Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 6 Dec 2009 14:08:39 +0100 Subject: fixed directory test --- ranger/directory.py | 4 ++-- test/tc_directory.py | 19 ------------------- 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 -- cgit 1.4.1-2-gfad0