~ubuntu-branches/debian/sid/cde/sid

« back to all changes in this revision

Viewing changes to tests/readlink_abspath_test/readlink_abspath_test.py

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2012-02-03 19:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20120203192705-ll6f1nr45ead65ed
Tags: upstream-0.1
ImportĀ upstreamĀ versionĀ 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'''
 
2
Setup: libc.so.6 in this directory is a symlink to the following absolute path:
 
3
  /lib/libc.so.6
 
4
 
 
5
Test to make sure that calling readlink('libc.so.6') returns '/lib/libc.so.6'
 
6
 
 
7
---
 
8
 
 
9
Note that this requires some special handling in CDE's readlink handler,
 
10
since the version of the symlink within the package actually refers to
 
11
the following RELATIVE path:
 
12
 
 
13
  ./../../../../..//lib/libc.so.6
 
14
 
 
15
This is because the libc.so.6 file is actually located in:
 
16
 
 
17
  cde-package/cde-root/home/pgbovine/CDE/tests/readlink_abspath_test/libc.so.6
 
18
 
 
19
within the package, so in order to reference the version of "/lib/libc.so.6"
 
20
WITHIN THE PACKAGE, the symlink is actually a relative link with the following
 
21
ugly prefix: ./../../../../../
 
22
 
 
23
'''
 
24
 
 
25
import os
 
26
 
 
27
assert os.path.islink('libc.so.6')
 
28
print os.readlink('libc.so.6')