@tf.test.mock.patch.object(logging, 'warning', autospec=True)
def test_instance_fn_with_one_line_doc(self, mock_warning):
    date = '2016-07-04'
    instructions = 'This is how you update...'

    class _Object(object):

        def __init(self):
            pass

        @deprecation.deprecated(date, instructions)
        def _fn(self, arg0, arg1):
            'fn doc.'
            return (arg0 + arg1)
    self.assertEqual(('fn doc. (deprecated)\n\nTHIS FUNCTION IS DEPRECATED. It will be removed after %s.\nInstructions for updating:\n%s' % (date, instructions)), getattr(_Object, '_fn').__doc__)
    self.assertEqual(3, _Object()._fn(1, 2))
    self.assertEqual(1, mock_warning.call_count)
    (args, _) = mock_warning.call_args
    self.assertRegexpMatches(args[0], 'deprecated and will be removed after')
    self._assert_subset(set([date, instructions]), set(args[1:]))
@tf.test.mock.patch.object(logging, 'warning', autospec=True)
def test_instance_fn_with_one_line_doc(self, mock_warning):
    date = '2016-07-04'
    instructions = 'This is how you update...'

    class _Object(object):

        def __init(self):
            pass

        @deprecation.deprecated(date, instructions)
        def _fn(self, arg0, arg1):
            'fn doc.'
            return (arg0 + arg1)
    self.assertEqual(('fn doc. (deprecated)\n\nTHIS FUNCTION IS DEPRECATED. It will be removed after %s.\nInstructions for updating:\n%s' % (date, instructions)), getattr(_Object, '_fn').__doc__)
    self.assertEqual(3, _Object()._fn(1, 2))
    self.assertEqual(1, mock_warning.call_count)
    (args, _) = mock_warning.call_args
    self.assertRegexpMatches(args[0], 'deprecated and will be removed after')
    self._assert_subset(set([date, instructions]), set(args[1:]))