Unit tests for array key exists Python