Esempio n. 1
0
 def test_parent_path_raises(self):
     filepath = '/bad/path'
     with self.assertRaisesWithLiteralMatch(
             ValueError,
             'Filepath "/bad/path" does not contain repo root "tensorflow/python"'
     ):
         tpu_test_wrapper.calculate_parent_python_path(filepath)
Esempio n. 2
0
 def test_parent_path(self):
     filepath = '/filesystem/path/tensorflow/python/tpu/example_test.runfiles/tensorflow/python/tpu/example_test'  # pylint: disable=line-too-long
     self.assertEqual(
         tpu_test_wrapper.calculate_parent_python_path(filepath),
         'tensorflow.python.tpu')
Esempio n. 3
0
 def test_parent_path(self):
     filepath = '/filesystem/path/tensorflow/tensorflow/python/tpu/example_test'
     self.assertEqual(
         tpu_test_wrapper.calculate_parent_python_path(filepath),
         'tensorflow.python.tpu')