annotate tests/doctest.txt @ 0:c8c2d98afc98

initial commit (stub)
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 18 Mar 2012 20:37:19 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 Test lockedfile
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 ================
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 The obligatory imports::
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 >>> import lockedfile
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 >>> import tempfile
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 Make a locked file::
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 >>> filename = tempfile.mktemp()
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 >>> f = lockedfile.LockedFile(filename, 'w')
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 The file is initially unlocked::
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 >>> f.locked()
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 False
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 Merge example::
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20
c8c2d98afc98 initial commit (stub)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 >>> NotImplementedError # TODO