Пример #1
0
 def testNoneError(self):
     fname = 'markers/box_marker/wrong'
     root_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
     with self.assertRaises(NameError) as e:
         filename = _find_file(root_dir, fname)
     self.assertIn('Unable to locate a test specification',
                   str(e.exception))
Пример #2
0
    def testEndswith(self):
        fname = 'markers/box_marker/tests'
        root_dir = mooseutils.git_root_dir(os.path.dirname(__file__))

        filename = _find_file(root_dir, fname)
        self.assertEqual(
            filename,
            os.path.join(root_dir, 'test', 'tests', 'markers', 'box_marker',
                         'tests'))
Пример #3
0
 def testToManyError(self):
     fname = 'box_marker/tests'
     root_dir = mooseutils.git_root_dir(os.path.dirname(__file__))
     with self.assertRaises(NameError) as e:
         filename = _find_file(root_dir, fname)
     self.assertIn('Located multiple test specifications', str(e.exception))
Пример #4
0
    def testExact(self):
        fname = '/test/tests/kernels/simple_diffusion/tests'
        root_dir = mooseutils.git_root_dir(os.path.dirname(__file__))

        filename = _find_file(root_dir, fname)
        self.assertEqual(filename, os.path.join(root_dir, fname.strip('/')))