Largest key

Write a function that receives a dictionary with only String keys and returns the longest key in the dictionary. Example:

longest_key({'hello': 'World', 'abc': 123})  # hello
longest_key({})  # None
import unittest


class LongestKeyTestCase(unittest.TestCase):

    def test_long_key(self):
        self.assertEqual(
            longest_key({'abcd': 'XXYYZZ', 'ac': 'MMM'}), 'abcd')

    def test_none_items(self):
        self.assertEqual(longest_key({}), None)