def test_non_existing_absolute_paths_are_not_normalized(self): cache = ImportCache() path = join(abspath('.'), '.', 'NonExisting.file') value = object() cache[path] = value assert_equals(cache[path], value) assert_equals(cache._keys[0], path)
def test_existing_absolute_paths_are_normalized(self): cache = ImportCache() path = join(abspath('.'), '.', os.listdir('.')[0]) value = object() cache[path] = value assert_equals(cache[path], value) assert_equals(cache._keys[0], normpath(path))
def test_existing_non_absolute_paths_are_not_normalized(self): cache = ImportCache() path = os.listdir('.')[0] value = object() cache[path] = value assert_equals(cache[path], value) assert_equals(cache._keys[0], path)
def setUp(self): self.cache = ImportCache() self.cache[('lib', ['a1', 'a2'])] = 'Library' self.cache['res'] = 'Resource'