Skip to content

Commit

Permalink
Delint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 5, 2012
1 parent bb52069 commit 845835d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test_path.py
Expand Up @@ -19,8 +19,15 @@
"""

from __future__ import with_statement # Needed for Python 2.5

import unittest
import codecs, os, random, shutil, tempfile, time
import codecs
import os
import random
import shutil
import tempfile
import time

from path import path, __version__ as path_version

# This should match the version of path.py being tested.
Expand All @@ -33,12 +40,11 @@ def p(**choices):

class BasicTestCase(unittest.TestCase):
def testRelpath(self):
root = path(p(nt='C:\\',
posix='/'))
root = path(p(nt='C:\\', posix='/'))
foo = root / 'foo'
quux = foo / 'quux'
bar = foo / 'bar'
boz = bar / 'Baz' / 'Boz'
quux = foo / 'quux'
bar = foo / 'bar'
boz = bar / 'Baz' / 'Boz'
up = path(os.pardir)

# basics
Expand Down Expand Up @@ -143,7 +149,6 @@ def testContextManager(self):
self.assertEquals(os.getcwd(), os.path.realpath(subdir))
self.assertEquals(os.getcwd(), old_dir)


def testTouch(self):
# NOTE: This test takes a long time to run (~10 seconds).
# It sleeps several seconds because on Windows, the resolution
Expand Down Expand Up @@ -246,7 +251,7 @@ def testMakeDirs(self):
tempf.touch()
try:
foo = d / 'foo'
boz = foo / 'bar' / 'baz' / 'boz'
boz = foo / 'bar' / 'baz' / 'boz'
boz.makedirs()
try:
self.assert_(boz.isdir())
Expand Down Expand Up @@ -354,7 +359,7 @@ def assertList(self, listing, expected):

def testPatterns(self):
d = path(self.tempdir)
names = [ 'x.tmp', 'x.xtmp', 'x2g', 'x22', 'x.txt' ]
names = ['x.tmp', 'x.xtmp', 'x2g', 'x22', 'x.txt']
dirs = [d, d/'xdir', d/'xdir.tmp', d/'xdir.tmp'/'xsubdir']

for e in dirs:
Expand Down Expand Up @@ -474,7 +479,6 @@ def testLinesep(eol):
testLinesep(u'\r\n')
testLinesep(u'\x0d\x85')


# Again, but with linesep=None.
p.write_lines(givenLines, enc, linesep=None)
p.write_lines(givenLines, enc, linesep=None, append=True)
Expand Down

0 comments on commit 845835d

Please sign in to comment.