def test_getline(self):
    getline = linecache.getline
    self.assertEqual(getline(FILENAME, (2 ** 15)), EMPTY)
    self.assertEqual(getline(FILENAME, (- 1)), EMPTY)
    self.assertRaises(TypeError, getline, FILENAME, 1.1)
    self.assertEqual(getline(EMPTY, 1), EMPTY)
    self.assertEqual(getline(INVALID_NAME, 1), EMPTY)
    for entry in TESTS:
        filename = (os.path.join(TEST_PATH, entry) + '.py')
        with open(filename) as file:
            for (index, line) in enumerate(file):
                self.assertEqual(line, getline(filename, (index + 1)))
    for entry in MODULES:
        filename = (os.path.join(MODULE_PATH, entry) + '.py')
        with open(filename) as file:
            for (index, line) in enumerate(file):
                self.assertEqual(line, getline(filename, (index + 1)))
    empty = linecache.getlines('a/b/c/__init__.py')
    self.assertEqual(empty, [])
def test_getline(self):
    getline = linecache.getline
    self.assertEqual(getline(FILENAME, (2 ** 15)), EMPTY)
    self.assertEqual(getline(FILENAME, (- 1)), EMPTY)
    self.assertRaises(TypeError, getline, FILENAME, 1.1)
    self.assertEqual(getline(EMPTY, 1), EMPTY)
    self.assertEqual(getline(INVALID_NAME, 1), EMPTY)
    for entry in TESTS:
        filename = (os.path.join(TEST_PATH, entry) + '.py')
        with open(filename) as file:
            for (index, line) in enumerate(file):
                self.assertEqual(line, getline(filename, (index + 1)))
    for entry in MODULES:
        filename = (os.path.join(MODULE_PATH, entry) + '.py')
        with open(filename) as file:
            for (index, line) in enumerate(file):
                self.assertEqual(line, getline(filename, (index + 1)))
    empty = linecache.getlines('a/b/c/__init__.py')
    self.assertEqual(empty, [])