Add test_keys.py and update keys.py