def testBasic(self): items = _doc_import(content=['framework/doc/content/**', '~framework/doc/content/documentation/**'], root_dir=ROOT_DIR) self.assertIsInstance(items, list) gold = '{}/framework/doc/content/documentation/systems/Kernels/framework/Diffusion.md' self.assertNotIn(gold.format(ROOT_DIR), items)
def testFilename(self): items = _doc_import(content=['framework/doc/content/getting_started/*', '~framework/doc/content/utilities/memory_logger/*', '~framework/doc/**/MooseDocs/*'], root_dir=ROOT_DIR) self.assertIsInstance(items, list) gold = '{}/framework/doc/content/utilities/MooseDocs/index.md' self.assertNotIn(gold.format(ROOT_DIR), items) gold = '{}/framework/doc/content/documentation/systems/Kernels/framework/Diffusion.md' self.assertNotIn(gold.format(ROOT_DIR), items) gold = '{}/framework/doc/content/utilities/memory_logger/memory_logger.md' self.assertNotIn(gold.format(ROOT_DIR), items) gold = '{}/framework/doc/content/utilities/moose_docs/moose_markdown/index.md' self.assertNotIn(gold.format(ROOT_DIR), items)
def testErrors(self, mock): _doc_import(os.getcwd(), content=dict()) args, _ = mock.call_args self.assertIn('The "content" must be a list of str items.', args[-1]) _doc_import(os.getcwd(), content=[1]) args, _ = mock.call_args self.assertIn('The "content" must be a list of str items.', args[-1]) _doc_import('not/valid', content=['foo']) args, _ = mock.call_args self.assertIn('The "root_dir" must be a valid directory', args[-2])