aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/util/deprecation_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/util/deprecation_test.py')
-rw-r--r--tensorflow/python/util/deprecation_test.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tensorflow/python/util/deprecation_test.py b/tensorflow/python/util/deprecation_test.py
index 1ea695e4d6..90c73a0a58 100644
--- a/tensorflow/python/util/deprecation_test.py
+++ b/tensorflow/python/util/deprecation_test.py
@@ -935,5 +935,27 @@ class DeprecationArgumentsTest(test.TestCase):
self.assertEqual(new_docs, new_docs_ref)
+class DeprecatedEndpointsTest(test.TestCase):
+
+ def testSingleDeprecatedEndpoint(self):
+ @deprecation.deprecated_endpoints("foo1")
+ def foo():
+ pass
+ self.assertEqual(("foo1",), foo._tf_deprecated_api_names)
+
+ def testMultipleDeprecatedEndpoint(self):
+ @deprecation.deprecated_endpoints("foo1", "foo2")
+ def foo():
+ pass
+ self.assertEqual(("foo1", "foo2"), foo._tf_deprecated_api_names)
+
+ def testCannotSetDeprecatedEndpointsTwice(self):
+ with self.assertRaises(deprecation.DeprecatedNamesAlreadySet):
+ @deprecation.deprecated_endpoints("foo1")
+ @deprecation.deprecated_endpoints("foo2")
+ def foo(): # pylint: disable=unused-variable
+ pass
+
+
if __name__ == "__main__":
test.main()