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)
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')
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')