summaryrefslogtreecommitdiff
path: root/testsuite/test_util.py
blob: 84b736a9cdd697894baea8a9120e7816e054c841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest

import pep8


class UtilTestCase(unittest.TestCase):
    def test_normalize_paths(self):
        cwd = os.getcwd()

        self.assertEquals(pep8.normalize_paths(''), [])
        self.assertEquals(pep8.normalize_paths(['foo']), ['foo'])
        self.assertEquals(pep8.normalize_paths('foo'), ['foo'])
        self.assertEquals(pep8.normalize_paths('foo,bar'), ['foo', 'bar'])
        self.assertEquals(pep8.normalize_paths('/foo/bar,baz/../bat'),
                          ['/foo/bar', cwd + '/bat'])
        self.assertEquals(pep8.normalize_paths(".pyc,\n   build/*"),
                          ['.pyc', cwd + '/build/*'])