From a7c5df6253a18369b4a7f42b7824ae9717af5ed3 Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Fri, 26 Feb 2016 12:26:41 -0800 Subject: [PATCH] renaming testdata to sample-documents --- tests/example.py | 16 ++++++++-------- .../docbook4xml-simple.xml | 0 .../docbook5xml-simple.xml | 0 .../docbooksgml-simple.sgml | 0 .../linuxdoc-simple.sgml | 0 .../markdown-simple.md | 0 .../restructuredtext-simple.rst | 0 .../text-simple.txt | 0 tests/test_inventory.py | 2 -- tests/test_outputs.py | 2 -- tests/test_sources.py | 2 +- tests/test_utils.py | 12 ++++++------ 12 files changed, 15 insertions(+), 19 deletions(-) rename tests/{testdata => sample-documents}/docbook4xml-simple.xml (100%) rename tests/{testdata => sample-documents}/docbook5xml-simple.xml (100%) rename tests/{testdata => sample-documents}/docbooksgml-simple.sgml (100%) rename tests/{testdata => sample-documents}/linuxdoc-simple.sgml (100%) rename tests/{testdata => sample-documents}/markdown-simple.md (100%) rename tests/{testdata => sample-documents}/restructuredtext-simple.rst (100%) rename tests/{testdata => sample-documents}/text-simple.txt (100%) diff --git a/tests/example.py b/tests/example.py index 03cba48..31a6072 100644 --- a/tests/example.py +++ b/tests/example.py @@ -13,48 +13,48 @@ import tldp.doctypes opj = os.path.join opd = os.path.dirname opa = os.path.abspath -testdatadir = opa(opj(opd(__file__), 'testdata')) +sampledocs = opa(opj(opd(__file__), 'sample-documents')) ex_linuxdoc = SimpleNamespace( ext='.sgml', type=tldp.doctypes.linuxdoc.Linuxdoc, - filename=opj(testdatadir, 'linuxdoc-simple.sgml'), + filename=opj(sampledocs, 'linuxdoc-simple.sgml'), ) ex_docbooksgml = SimpleNamespace( ext='.sgml', type=tldp.doctypes.docbooksgml.DocbookSGML, - filename=opj(testdatadir, 'docbooksgml-simple.sgml'), + filename=opj(sampledocs, 'docbooksgml-simple.sgml'), ) ex_docbook4xml = SimpleNamespace( ext='.xml', type=tldp.doctypes.docbook4xml.Docbook4XML, - filename=opj(testdatadir, 'docbook4xml-simple.xml'), + filename=opj(sampledocs, 'docbook4xml-simple.xml'), ) ex_docbook5xml = SimpleNamespace( ext='.xml', type=tldp.doctypes.docbook5xml.Docbook5XML, - filename=opj(testdatadir, 'docbook5xml-simple.xml'), + filename=opj(sampledocs, 'docbook5xml-simple.xml'), ) ex_rst = SimpleNamespace( ext='.rst', type=tldp.doctypes.rst.RestructuredText, - filename=opj(testdatadir, 'restructuredtext-simple.rst'), + filename=opj(sampledocs, 'restructuredtext-simple.rst'), ) ex_text = SimpleNamespace( ext='.txt', type=tldp.doctypes.text.Text, - filename=opj(testdatadir, 'text-simple.txt'), + filename=opj(sampledocs, 'text-simple.txt'), ) ex_markdown = SimpleNamespace( ext='.md', type=tldp.doctypes.markdown.Markdown, - filename=opj(testdatadir, 'markdown-simple.md'), + filename=opj(sampledocs, 'markdown-simple.md'), ) diff --git a/tests/testdata/docbook4xml-simple.xml b/tests/sample-documents/docbook4xml-simple.xml similarity index 100% rename from tests/testdata/docbook4xml-simple.xml rename to tests/sample-documents/docbook4xml-simple.xml diff --git a/tests/testdata/docbook5xml-simple.xml b/tests/sample-documents/docbook5xml-simple.xml similarity index 100% rename from tests/testdata/docbook5xml-simple.xml rename to tests/sample-documents/docbook5xml-simple.xml diff --git a/tests/testdata/docbooksgml-simple.sgml b/tests/sample-documents/docbooksgml-simple.sgml similarity index 100% rename from tests/testdata/docbooksgml-simple.sgml rename to tests/sample-documents/docbooksgml-simple.sgml diff --git a/tests/testdata/linuxdoc-simple.sgml b/tests/sample-documents/linuxdoc-simple.sgml similarity index 100% rename from tests/testdata/linuxdoc-simple.sgml rename to tests/sample-documents/linuxdoc-simple.sgml diff --git a/tests/testdata/markdown-simple.md b/tests/sample-documents/markdown-simple.md similarity index 100% rename from tests/testdata/markdown-simple.md rename to tests/sample-documents/markdown-simple.md diff --git a/tests/testdata/restructuredtext-simple.rst b/tests/sample-documents/restructuredtext-simple.rst similarity index 100% rename from tests/testdata/restructuredtext-simple.rst rename to tests/sample-documents/restructuredtext-simple.rst diff --git a/tests/testdata/text-simple.txt b/tests/sample-documents/text-simple.txt similarity index 100% rename from tests/testdata/text-simple.txt rename to tests/sample-documents/text-simple.txt diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 75292e0..17388ef 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -15,8 +15,6 @@ import example # -- SUT from tldp.inventory import Inventory -datadir = os.path.join(os.path.dirname(__file__), 'testdata') - class TestOutputDirSkeleton(OutputNamingConvention): diff --git a/tests/test_outputs.py b/tests/test_outputs.py index 7d13960..1c8fc41 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -13,8 +13,6 @@ from tldp.outputs import OutputCollection from tldp.outputs import OutputDirectory from tldp.outputs import OutputNamingConvention -datadir = os.path.join(os.path.dirname(__file__), 'testdata') - class TestOutputNamingConvention(unittest.TestCase): diff --git a/tests/test_sources.py b/tests/test_sources.py index aa4e0c7..6e35878 100644 --- a/tests/test_sources.py +++ b/tests/test_sources.py @@ -19,7 +19,7 @@ import example # -- SUT 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): diff --git a/tests/test_utils.py b/tests/test_utils.py index 518d97a..72eaf2a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -62,24 +62,24 @@ class Test_arg_isloglevel(unittest.TestCase): class Test_execute(TestToolsFilesystem): def test_execute_returns_zero(self): - exe = which ('true') + exe = which('true') result = execute([exe], logdir=self.tempdir) self.assertEqual(0, result) def test_execute_returns_nonzero(self): - exe = which ('false') + exe = which('false') result = execute([exe], logdir=self.tempdir) self.assertEqual(1, result) def test_execute_exception_when_logdir_none(self): - exe = which ('true') + exe = which('true') with self.assertRaises(ValueError) as ecm: execute([exe], logdir=None) e = ecm.exception self.assertTrue('logdir must be a directory' in e.message) def test_execute_exception_when_logdir_enoent(self): - exe = which ('true') + exe = which('true') logdir = os.path.join(self.tempdir, 'nonexistent-directory') with self.assertRaises(IOError) as ecm: execute([exe], logdir=logdir) @@ -114,11 +114,11 @@ class Test_which(unittest.TestCase): class Test_statfiles(unittest.TestCase): 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__)) statinfo = statfiles(here, relative=here) 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): here = os.path.dirname(os.path.abspath(__file__))