TestMaker fails if context dict does not contain the keys attribute

Makes sure that a context dict actually has keys before appending them.