'Even if the implementation of a deprecated function is moved around on
the filesystem, the line number in the warning emitted by
L{deprecate.warnAboutFunction} points to a line in the implementation of
the deprecated function.'

def test_renamedFile(self):

    from twisted_private_helper import module
    del sys.modules['twisted_private_helper']
    del sys.modules[module.__name__]
    self.package.moveTo(self.package.sibling('twisted_renamed_helper'))
    if invalidate_caches:
        invalidate_caches()
    from twisted_renamed_helper import module
    self.addCleanup(sys.modules.pop, 'twisted_renamed_helper')
    self.addCleanup(sys.modules.pop, module.__name__)
    module.callTestFunction()
    warningsShown = self.flushWarnings([module.testFunction])
    warnedPath = FilePath(warningsShown[0]['filename'].encode('utf-8'))
    expectedPath = self.package.sibling('twisted_renamed_helper').child('module.py')
    self.assertSamePath(warnedPath, expectedPath)
    self.assertEqual(warningsShown[0]['lineno'], 9)
    self.assertEqual(warningsShown[0]['message'], 'A    Warning    String')
    self.assertEqual(len(warningsShown), 1)
