mirror of https://github.com/tLDP/python-tldp
pep8 and pyflakes fixes
This commit is contained in:
parent
9845e90a39
commit
d91f253bd4
|
@ -4,20 +4,9 @@ from __future__ import absolute_import, division, print_function
|
|||
import os
|
||||
import errno
|
||||
import unittest
|
||||
from tempfile import NamedTemporaryFile as ntf
|
||||
from tempfile import mkdtemp, mkstemp
|
||||
import shutil
|
||||
import random
|
||||
|
||||
try:
|
||||
from types import SimpleNamespace
|
||||
except ImportError:
|
||||
from utils import SimpleNamespace
|
||||
|
||||
from tldptesttools import *
|
||||
|
||||
# -- Test Data
|
||||
import example
|
||||
from tldptesttools import TestToolsFilesystem
|
||||
|
||||
# -- SUT
|
||||
from tldp.outputs import OutputCollection
|
||||
|
@ -71,7 +60,5 @@ class TestOutputDirectory(TestToolsFilesystem):
|
|||
e = ecm.exception
|
||||
self.assertEquals(errno.ENOENT, e.errno)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# -- end of file
|
||||
|
|
|
@ -3,10 +3,6 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
import os
|
||||
import errno
|
||||
import unittest
|
||||
from tempfile import NamedTemporaryFile as ntf
|
||||
from tempfile import mkdtemp, mkstemp
|
||||
import shutil
|
||||
import random
|
||||
|
||||
try:
|
||||
|
@ -14,7 +10,7 @@ try:
|
|||
except ImportError:
|
||||
from utils import SimpleNamespace
|
||||
|
||||
from tldptesttools import *
|
||||
from tldptesttools import TestToolsFilesystem
|
||||
|
||||
# -- Test Data
|
||||
import example
|
||||
|
@ -34,7 +30,7 @@ class TestFileSourceCollectionMultiDir(TestToolsFilesystem):
|
|||
documents = (doc0, doc1)
|
||||
for d in documents:
|
||||
d.reldir, d.absdir = self.adddir(d.reldir)
|
||||
d.relname, d.absname = self.addfile(d.reldir, ex.filename, stem=d.stem)
|
||||
_, _ = self.addfile(d.reldir, ex.filename, stem=d.stem)
|
||||
s = SourceCollection([x.absdir for x in documents])
|
||||
self.assertEquals(2, len(s))
|
||||
expected = set([x.stem for x in documents])
|
||||
|
@ -48,7 +44,7 @@ class TestFileSourceCollectionMultiDir(TestToolsFilesystem):
|
|||
documents = (doc0, doc1)
|
||||
for d in documents:
|
||||
d.reldir, d.absdir = self.adddir(d.reldir)
|
||||
d.relname, d.absname = self.addfile(d.reldir, ex.filename, stem=d.stem)
|
||||
_, _ = self.addfile(d.reldir, ex.filename, stem=d.stem)
|
||||
s = SourceCollection([x.absdir for x in documents])
|
||||
self.assertEquals(1, len(s))
|
||||
expected = set([x.stem for x in documents])
|
||||
|
|
|
@ -5,7 +5,7 @@ import os
|
|||
import unittest
|
||||
from tempfile import NamedTemporaryFile as ntf
|
||||
|
||||
from tldptesttools import *
|
||||
from tldptesttools import TestToolsFilesystem
|
||||
|
||||
# -- SUT
|
||||
from tldp.utils import makefh, which, getfileset, execute
|
||||
|
|
|
@ -3,14 +3,16 @@ from __future__ import absolute_import, division, print_function
|
|||
|
||||
import os
|
||||
import unittest
|
||||
from tempfile import mkdtemp, mkstemp
|
||||
from tempfile import mkdtemp
|
||||
import shutil
|
||||
|
||||
|
||||
def stem_and_ext(name):
|
||||
stem, ext = os.path.splitext(os.path.basename(name))
|
||||
assert ext != ''
|
||||
return stem, ext
|
||||
|
||||
|
||||
def dir_to_components(reldir):
|
||||
reldir, basename = os.path.split(os.path.normpath(reldir))
|
||||
components = [basename]
|
||||
|
|
Loading…
Reference in New Issue