Esempio n. 1
0
 def test_sgid_to_name(self):
     _groupname_cache.pop(self.sgid,
                          None)  # make sure test group isn't in the cache
     sg_name = sgid_to_name(self.aws, self.sgid)
     self.aws.SecurityGroups.get.called_with(
         filters={'group-id': self.sgid})
     self.assertEqual(self.group["GroupName"], sg_name)
 def test_lookup_uses_cache(self):
     # prime the cache
     _groupname_cache[self.sgid] = self.group["GroupName"]
     sgid_to_name(self.aws, self.sgid)
     self.assertFalse(self.aws.get_all_security_groups.called)
 def test_lookup_caches_name(self):
     _groupname_cache.pop(self.sgid, None)  # make sure test group isn't in the cache
     sgid_to_name(self.aws, self.sgid)
     self.assertIn(self.sgid, _groupname_cache)
 def test_sgid_to_name(self):
     _groupname_cache.pop(self.sgid, None)  # make sure test group isn't in the cache
     sg_name = sgid_to_name(self.aws, self.sgid)
     self.aws.SecurityGroups.get.called_with(filters={'group-id': self.sgid})
     self.assertEqual(self.group["GroupName"], sg_name)
Esempio n. 5
0
 def test_lookup_uses_cache(self):
     # prime the cache
     _groupname_cache[self.sgid] = self.group["GroupName"]
     sgid_to_name(self.aws, self.sgid)
     self.assertFalse(self.aws.get_all_security_groups.called)
Esempio n. 6
0
 def test_lookup_caches_name(self):
     _groupname_cache.pop(self.sgid,
                          None)  # make sure test group isn't in the cache
     sgid_to_name(self.aws, self.sgid)
     self.assertIn(self.sgid, _groupname_cache)