From 44a3688e81ab3f7eba422f1713cc7332d409604b Mon Sep 17 00:00:00 2001 From: Rodolfo Miranda Date: Wed, 2 Oct 2024 14:32:56 -0300 Subject: [PATCH] fix and add test --- src/keria/app/agenting.py | 3 +-- tests/app/test_agenting.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/keria/app/agenting.py b/src/keria/app/agenting.py index 588e5ff..7876073 100644 --- a/src/keria/app/agenting.py +++ b/src/keria/app/agenting.py @@ -234,7 +234,7 @@ def delete(self, agent): def shut(self, agent): logger.info(f"closing idle agent {agent.caid}") - self.remove(agent.doers) + agent.remove(agent.doers) self.remove([agent]) del self.agents[agent.caid] agent.hby.ks.close(clear=False) @@ -247,7 +247,6 @@ def shut(self, agent): agent.mgr.rb.close(clear=False) agent.hby.close(clear=False) - def get(self, caid): if caid in self.agents: agent = self.agents[caid] diff --git a/tests/app/test_agenting.py b/tests/app/test_agenting.py index 7cc253d..2a31c2c 100644 --- a/tests/app/test_agenting.py +++ b/tests/app/test_agenting.py @@ -193,6 +193,9 @@ def test_agency(): if os.path.exists(f'/usr/local/var/keri/adb/{base}'): shutil.rmtree(f'/usr/local/var/keri/adb/{base}') + agency.shut(agent) + assert caid not in agency.agents + assert len(agent.doers) == 0 def test_boot_ends(helpers): agency = agenting.Agency(name="agency", bran=None, temp=True)