)]}'
{"keystone/tests/unit/token/test_fernet_provider.py":[{"author":{"_account_id":5046,"name":"Lance Bragstad","email":"lbragstad@redhat.com","username":"ldbragst"},"change_message_id":"7b8738f72905327063758fe43af8a281ec6677b7","unresolved":false,"context_lines":[{"line_number":670,"context_line":"        )"},{"line_number":671,"context_line":"        keys \u003d key_utils.load_keys()"},{"line_number":672,"context_line":"        self.assertEqual(2, len(keys))"},{"line_number":673,"context_line":"        self.assertGreater(len(keys[0]), 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_1d68d486","line":673,"updated":"2017-01-04 22:49:08.000000000","message":"Technically - I think this is fine since keys is just a list. It\u0027s just a little weird to look at the syntax and figure out what we\u0027re asserting. What we\u0027re doing here is just making sure the first key in the list is actually not empty. If we really wanted to be verbose I guess we could add a comment explaining why the assertion is being made (like, why aren\u0027t we checking the same thing for the second key in the list?). We could also do:\n\n  self.assertIsInstance(keys[0], str)\n\nBut, we could just make our own key assertion function, too\n\n  def assertValidFernetKey(self, key):\n      # ensure the length of the key is greater than 0\n      self.assertGreater(len(keys[0], 0)\n      # ensure the key is actually a string\n      self.assertIsInstance(key, str)\n\nThen this test would turn into:\n\n  keys \u003d key_utils.load_keys()\n  for key in keys:\n      self.assertValidFernetKey(key)\n\nWhich might seem to a little more readable to some.","commit_id":"9fc3e3d2e0856ad2be324bb1148eb20291383c23"},{"author":{"_account_id":11022,"name":"Rodrigo Duarte Sousa","email":"rodrigodsousa@gmail.com","username":"rodrigods"},"change_message_id":"5cea33b4b435cd0aeaaff0b58b97a18bb7e98959","unresolved":false,"context_lines":[{"line_number":670,"context_line":"        )"},{"line_number":671,"context_line":"        keys \u003d key_utils.load_keys()"},{"line_number":672,"context_line":"        self.assertEqual(2, len(keys))"},{"line_number":673,"context_line":"        self.assertGreater(len(keys[0]), 0)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_dff46b5c","line":673,"in_reply_to":"ba5201f7_1d68d486","updated":"2017-01-05 13:19:23.000000000","message":"nice explanation, your custom assertion suggestion looks much better to me.","commit_id":"9fc3e3d2e0856ad2be324bb1148eb20291383c23"}]}
