mirror of https://github.com/tLDP/python-tldp
renaming testdata to sample-documents
This commit is contained in:
parent
f40ff2f915
commit
a7c5df6253
|
@ -13,48 +13,48 @@ import tldp.doctypes
|
||||||
opj = os.path.join
|
opj = os.path.join
|
||||||
opd = os.path.dirname
|
opd = os.path.dirname
|
||||||
opa = os.path.abspath
|
opa = os.path.abspath
|
||||||
testdatadir = opa(opj(opd(__file__), 'testdata'))
|
sampledocs = opa(opj(opd(__file__), 'sample-documents'))
|
||||||
|
|
||||||
ex_linuxdoc = SimpleNamespace(
|
ex_linuxdoc = SimpleNamespace(
|
||||||
ext='.sgml',
|
ext='.sgml',
|
||||||
type=tldp.doctypes.linuxdoc.Linuxdoc,
|
type=tldp.doctypes.linuxdoc.Linuxdoc,
|
||||||
filename=opj(testdatadir, 'linuxdoc-simple.sgml'),
|
filename=opj(sampledocs, 'linuxdoc-simple.sgml'),
|
||||||
)
|
)
|
||||||
|
|
||||||
ex_docbooksgml = SimpleNamespace(
|
ex_docbooksgml = SimpleNamespace(
|
||||||
ext='.sgml',
|
ext='.sgml',
|
||||||
type=tldp.doctypes.docbooksgml.DocbookSGML,
|
type=tldp.doctypes.docbooksgml.DocbookSGML,
|
||||||
filename=opj(testdatadir, 'docbooksgml-simple.sgml'),
|
filename=opj(sampledocs, 'docbooksgml-simple.sgml'),
|
||||||
)
|
)
|
||||||
|
|
||||||
ex_docbook4xml = SimpleNamespace(
|
ex_docbook4xml = SimpleNamespace(
|
||||||
ext='.xml',
|
ext='.xml',
|
||||||
type=tldp.doctypes.docbook4xml.Docbook4XML,
|
type=tldp.doctypes.docbook4xml.Docbook4XML,
|
||||||
filename=opj(testdatadir, 'docbook4xml-simple.xml'),
|
filename=opj(sampledocs, 'docbook4xml-simple.xml'),
|
||||||
)
|
)
|
||||||
|
|
||||||
ex_docbook5xml = SimpleNamespace(
|
ex_docbook5xml = SimpleNamespace(
|
||||||
ext='.xml',
|
ext='.xml',
|
||||||
type=tldp.doctypes.docbook5xml.Docbook5XML,
|
type=tldp.doctypes.docbook5xml.Docbook5XML,
|
||||||
filename=opj(testdatadir, 'docbook5xml-simple.xml'),
|
filename=opj(sampledocs, 'docbook5xml-simple.xml'),
|
||||||
)
|
)
|
||||||
|
|
||||||
ex_rst = SimpleNamespace(
|
ex_rst = SimpleNamespace(
|
||||||
ext='.rst',
|
ext='.rst',
|
||||||
type=tldp.doctypes.rst.RestructuredText,
|
type=tldp.doctypes.rst.RestructuredText,
|
||||||
filename=opj(testdatadir, 'restructuredtext-simple.rst'),
|
filename=opj(sampledocs, 'restructuredtext-simple.rst'),
|
||||||
)
|
)
|
||||||
|
|
||||||
ex_text = SimpleNamespace(
|
ex_text = SimpleNamespace(
|
||||||
ext='.txt',
|
ext='.txt',
|
||||||
type=tldp.doctypes.text.Text,
|
type=tldp.doctypes.text.Text,
|
||||||
filename=opj(testdatadir, 'text-simple.txt'),
|
filename=opj(sampledocs, 'text-simple.txt'),
|
||||||
)
|
)
|
||||||
|
|
||||||
ex_markdown = SimpleNamespace(
|
ex_markdown = SimpleNamespace(
|
||||||
ext='.md',
|
ext='.md',
|
||||||
type=tldp.doctypes.markdown.Markdown,
|
type=tldp.doctypes.markdown.Markdown,
|
||||||
filename=opj(testdatadir, 'markdown-simple.md'),
|
filename=opj(sampledocs, 'markdown-simple.md'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,6 @@ import example
|
||||||
# -- SUT
|
# -- SUT
|
||||||
from tldp.inventory import Inventory
|
from tldp.inventory import Inventory
|
||||||
|
|
||||||
datadir = os.path.join(os.path.dirname(__file__), 'testdata')
|
|
||||||
|
|
||||||
|
|
||||||
class TestOutputDirSkeleton(OutputNamingConvention):
|
class TestOutputDirSkeleton(OutputNamingConvention):
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@ from tldp.outputs import OutputCollection
|
||||||
from tldp.outputs import OutputDirectory
|
from tldp.outputs import OutputDirectory
|
||||||
from tldp.outputs import OutputNamingConvention
|
from tldp.outputs import OutputNamingConvention
|
||||||
|
|
||||||
datadir = os.path.join(os.path.dirname(__file__), 'testdata')
|
|
||||||
|
|
||||||
|
|
||||||
class TestOutputNamingConvention(unittest.TestCase):
|
class TestOutputNamingConvention(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import example
|
||||||
# -- SUT
|
# -- SUT
|
||||||
from tldp.sources import SourceCollection, SourceDocument, scansourcedirs
|
from tldp.sources import SourceCollection, SourceDocument, scansourcedirs
|
||||||
|
|
||||||
datadir = os.path.join(os.path.dirname(__file__), 'testdata')
|
datadir = os.path.join(os.path.dirname(__file__), 'sample-documents')
|
||||||
|
|
||||||
|
|
||||||
class TestFileSourceCollectionMultiDir(TestToolsFilesystem):
|
class TestFileSourceCollectionMultiDir(TestToolsFilesystem):
|
||||||
|
|
|
@ -114,11 +114,11 @@ class Test_which(unittest.TestCase):
|
||||||
class Test_statfiles(unittest.TestCase):
|
class Test_statfiles(unittest.TestCase):
|
||||||
|
|
||||||
def test_statfiles_dir_in_result(self):
|
def test_statfiles_dir_in_result(self):
|
||||||
'''Assumes that directory ./testdata/ exists here'''
|
'''Assumes that directory ./sample-documents/ exists here'''
|
||||||
here = os.path.dirname(os.path.abspath(__file__))
|
here = os.path.dirname(os.path.abspath(__file__))
|
||||||
statinfo = statfiles(here, relative=here)
|
statinfo = statfiles(here, relative=here)
|
||||||
self.assertIsInstance(statinfo, dict)
|
self.assertIsInstance(statinfo, dict)
|
||||||
self.assertTrue(os.path.basename('testdata') in statinfo)
|
self.assertTrue(os.path.basename('sample-documents') in statinfo)
|
||||||
|
|
||||||
def test_statfiles_dir_rel(self):
|
def test_statfiles_dir_rel(self):
|
||||||
here = os.path.dirname(os.path.abspath(__file__))
|
here = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
Loading…
Reference in New Issue