'Tests invoking FileInput.__getitem__() with an index unequal to
the line number'

def test__getitem__invalid_key(self):

    t = writeTmp(1, ['line1\n', 'line2\n'])
    self.addCleanup(remove_tempfiles, t)
    with FileInput(files=[t]) as fi:
        with self.assertRaises(RuntimeError) as cm:
            fi[1]
    self.assertEqual(cm.exception.args, ('accessing    lines    out    of    order',))
