def testAddOwnerFromDict(self):
     layered_cache.SetExternal(test_owner._MASTER_OWNER_CACHE_KEY,
                               _SAMPLE_OWNER_DICT)
     test_owner.AddOwnerFromDict(_ANOTHER_SAMPLE_OWNER_DICT)
     owner_dict = layered_cache.GetExternal(
         test_owner._MASTER_OWNER_CACHE_KEY)
     self.assertEqual(_COMBINED_SAMPLE_OWNER_DICT, owner_dict)
 def testPost_WithBugIdForBugThatHasOwner_ShowsOwnerInfo(self):
     sheriff_key = self._AddSheriff()
     test_keys = self._AddTests()
     bug_data.Bug(id=123).put()
     test_key = test_keys[0]
     test_path_parts = utils.TestPath(test_key).split('/')
     test_suite_path = '%s/%s' % (test_path_parts[0], test_path_parts[2])
     test_owner.AddOwnerFromDict({test_suite_path: ['*****@*****.**']})
     self._AddAnomalyEntities([(150, 250)],
                              test_key,
                              sheriff_key,
                              bug_id=123)
     response = self.testapp.post('/group_report?bug_id=123')
     owner_info = self.GetJsonValue(response, 'owner_info')
     self.assertEqual('*****@*****.**', owner_info[0]['email'])