Write an actual test for resource_loader_test
Exercise the code paths it triggers. Disable it on windows and pip packages for now. PiperOrigin-RevId: 293910406 Change-Id: Ie84a3a85ff1f471e3d7ed4b192701667481e8324
This commit is contained in:
parent
03a653e4d7
commit
52a820c507
@ -285,7 +285,14 @@ tf_py_test(
|
||||
name = "resource_loader_test",
|
||||
size = "small",
|
||||
srcs = ["platform/resource_loader_test.py"],
|
||||
data = [
|
||||
"platform/resource_loader.py",
|
||||
],
|
||||
python_version = "PY3",
|
||||
tags = [
|
||||
"no_pip",
|
||||
"no_windows",
|
||||
],
|
||||
deps = [
|
||||
":platform",
|
||||
":platform_test",
|
||||
|
@ -21,11 +21,17 @@ from tensorflow.python.platform import googletest
|
||||
from tensorflow.python.platform import resource_loader
|
||||
|
||||
|
||||
class DefaultResourceLoaderTest(googletest.TestCase):
|
||||
class ResourceLoaderTest(googletest.TestCase):
|
||||
|
||||
def test_exception(self):
|
||||
with self.assertRaises(IOError):
|
||||
resource_loader.load_resource("/fake/file/path/dne")
|
||||
|
||||
def test_exists(self):
|
||||
contents = resource_loader.load_resource(
|
||||
"python/platform/resource_loader.py")
|
||||
self.assertIn(b"tensorflow", contents)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
googletest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user