Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
vbraun committed Mar 15, 2015
1 parent 16cb948 commit e9ad72a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 2 additions & 7 deletions src/sage/repl/rich_output/backend_sagenb.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,9 @@ def _make_symlink_to_cell(self, filename):
sage: backend = BackendSageNB()
sage: cwd = os.getcwd()
sage: os.chdir(tmp_dir())
sage: lnk = backend._make_symlink_to_cell(png_file)
sage: lnk # random output
'2c45d92a-03e6-4a8b-bba9-011d622b64c9.png'
sage: os.path.islink(lnk)
True
sage: backend._make_symlink_to_cell(png_file) # random output
'cells/0/.files/5608054e-eb8f-4c56-9c20-3d581e0e56ef.png'
sage: os.chdir(cwd)
sage: os.path.islink(lnk)
False
"""
try:
os.makedirs('.files')
Expand Down
12 changes: 8 additions & 4 deletions src/sage/repl/saved_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ def __init__(self, filename, rich_output=None):
EXAMPLES::
sage: from sage.repl.rich_output.output_catalog import OutputImagePng
sage: png_file = OutputImagePng.example().png.filename(ext='filename.png')
sage: from sage.repl.saved_file import SavedFile
sage: SavedFile('/tmp/foo.png')
Saved file at /tmp/foo.png
sage: SavedFile(png_file)
Saved file at /...filename.png
"""
self._filename = filename
if rich_output is not None:
Expand Down Expand Up @@ -223,9 +225,11 @@ def basename(self):
EXAMPLES::
sage: from sage.repl.rich_output.output_catalog import OutputImagePng
sage: png_file = OutputImagePng.example().png.filename(ext='.png')
sage: from sage.repl.saved_file import SavedFile
sage: SavedFile('/tmp/foo.png').basename()
'foo.png'
sage: '/' in SavedFile(png_file).basename()
False
"""
return os.path.basename(self._filename)

Expand Down

0 comments on commit e9ad72a

Please sign in to comment.