Skip to content

Commit

Permalink
fix and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodolfomiranda committed Oct 2, 2024
1 parent 4a9d63d commit 44a3688
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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]
Expand Down
3 changes: 3 additions & 0 deletions tests/app/test_agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 44a3688

Please sign in to comment.