2004-11-09 08:11:09 +00:00
|
|
|
# -*- coding: iso-8859-1 -*-
|
2005-01-11 02:22:43 +00:00
|
|
|
# Copyright (C) 2004-2005 Bastian Kleineidam
|
2004-11-09 08:11:09 +00:00
|
|
|
#
|
|
|
|
|
# This program 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.
|
|
|
|
|
#
|
|
|
|
|
# This program 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 this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2005-01-19 15:08:02 +00:00
|
|
|
"""
|
|
|
|
|
Test filename routines.
|
|
|
|
|
"""
|
2004-11-09 08:11:09 +00:00
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
import os
|
|
|
|
|
from linkcheck.checker.fileurl import get_nt_filename
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestFilenames (unittest.TestCase):
|
2005-01-19 14:38:01 +00:00
|
|
|
"""
|
|
|
|
|
Test filename routines.
|
|
|
|
|
"""
|
2004-11-09 08:11:09 +00:00
|
|
|
|
|
|
|
|
def test_nt_filename (self):
|
|
|
|
|
path = os.getcwd()
|
|
|
|
|
realpath = get_nt_filename(path)
|
|
|
|
|
self.assertEquals(path, realpath)
|
|
|
|
|
if os.name == 'nt':
|
2005-05-18 18:04:05 +00:00
|
|
|
path = 'c:\\'
|
2004-11-09 08:11:09 +00:00
|
|
|
realpath = get_nt_filename(path)
|
2005-05-18 18:04:05 +00:00
|
|
|
self.assertEquals(path, realpath)
|
2004-11-09 08:11:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_suite ():
|
2005-01-19 14:38:01 +00:00
|
|
|
"""
|
|
|
|
|
Build and return a TestSuite.
|
|
|
|
|
"""
|
2005-07-15 14:24:25 +00:00
|
|
|
return unittest.makeSuite(TestFilenames)
|
|
|
|
|
|
2004-11-09 08:11:09 +00:00
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
unittest.main()
|