예제 #1
0
파일: test_alias.py 프로젝트: alanoe/pulp
 def test_translate(self, realpath):
     realpath.side_effect = lambda p: os.path.normpath(p.upper())
     table = AliasTable()
     table.table['A'] = '/tmp/test/path//a'
     table.table['B'] = '/tmp/test/path/b/'
     table.table['C'] = '/tmp/test///path/c'
     self.assertEqual(table.translate('A'), os.path.normpath(table.table['A']).upper())
     self.assertEqual(table.translate('B'), os.path.normpath(table.table['B']).upper())
     self.assertEqual(table.translate('C'), os.path.normpath(table.table['C']).upper())
예제 #2
0
 def test_translate(self, realpath):
     realpath.side_effect = lambda p: os.path.normpath(p.upper())
     table = AliasTable()
     table.table['A'] = '/tmp/test/path//a'
     table.table['B'] = '/tmp/test/path/b/'
     table.table['C'] = '/tmp/test///path/c'
     self.assertEqual(table.translate('A'),
                      os.path.normpath(table.table['A']).upper())
     self.assertEqual(table.translate('B'),
                      os.path.normpath(table.table['B']).upper())
     self.assertEqual(table.translate('C'),
                      os.path.normpath(table.table['C']).upper())
예제 #3
0
파일: test_alias.py 프로젝트: alanoe/pulp
 def test_translate_not_found(self, realpath):
     realpath.side_effect = lambda p: os.path.normpath(p.upper())
     table = AliasTable()
     path = '/my/unknown/path'
     self.assertEqual(table.translate(path), os.path.normpath(path).upper())
예제 #4
0
 def test_translate_not_found(self, realpath):
     realpath.side_effect = lambda p: os.path.normpath(p.upper())
     table = AliasTable()
     path = '/my/unknown/path'
     self.assertEqual(table.translate(path), os.path.normpath(path).upper())