Change to using resource_loader to find in-tree files.

PiperOrigin-RevId: 292043928
Change-Id: I4e71326d2daee6fac13e4600cb9f400af10571bb
This commit is contained in:
Brian Atkinson 2020-01-28 16:59:56 -08:00 committed by TensorFlower Gardener
parent d064c6fc9a
commit 8a1fa9c9bb

View File

@ -25,6 +25,7 @@ import sys
from tensorflow import python as _tf_for_api_traversal
from tensorflow.lite.python import lite as _tflite_for_api_traversal
# pylint: enable=unused-import
from tensorflow.python.platform import resource_loader
from tensorflow.python.platform import test
from tensorflow.python.util import tf_decorator
@ -158,8 +159,8 @@ class OutputInitFilesTest(test.TestCase):
def test_V2_init_files(self):
modules = _get_modules(
'tensorflow', '_tf_api_names', '_tf_api_constants')
file_path = (
'tensorflow/python/tools/api/generator/api_init_files.bzl')
file_path = resource_loader.get_path_to_datafile(
'api_init_files.bzl')
paths = _get_files_set(
file_path, '# BEGIN GENERATED FILES', '# END GENERATED FILES')
module_paths = set(
@ -170,8 +171,7 @@ class OutputInitFilesTest(test.TestCase):
def test_V1_init_files(self):
modules = _get_modules(
'tensorflow', '_tf_api_names_v1', '_tf_api_constants_v1')
file_path = (
'tensorflow/python/tools/api/generator/'
file_path = resource_loader.get_path_to_datafile(
'api_init_files_v1.bzl')
paths = _get_files_set(
file_path, '# BEGIN GENERATED FILES', '# END GENERATED FILES')