# This file is part of Navidoc. # # Navidoc is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Navidoc is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General # Public License along with Navidoc; if not, write to the Free # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # # $Id: path.test,v 1.3 2003/06/30 14:01:20 humppake Exp $ # # Written by Asko Soukka # def test_slashify(): """Test slashifying a path.""" from navidoc.util.path import slashify assert slashify('') == '', slashify('') assert slashify('foo') == 'foo/', slashify('foo') assert slashify('foo/') == 'foo/', slashify('foo/') def test_relative_path(): """Test building of relative path.""" from navidoc.util.path import relative_path assert relative_path('navidoc', 'test') == '../test/', relative_path('navidoc', 'test') assert relative_path('', 'test') == 'test', relative_path('', 'test') assert relative_path('navidoc', 'Makefile') == '../Makefile', relative_path('navidoc', 'Makefile') assert relative_path('navidoc/__init__.py', 'Makefile') == '../Makefile', relative_path('navidoc/__init__.py', 'Makefile') assert relative_path('navidoc/util', 'test/path.test') == '../../test/path.test', relative_path('navidoc/util', 'test/path.test')