Skip to content

Commit

Permalink
Merge pull request #24 from Local-Connectivity-Lab/ticket-1036
Browse files Browse the repository at this point in the history
hiding blocked and users group
  • Loading branch information
philion authored Jul 11, 2024
2 parents 6afba81 + 0369b56 commit f44aa53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cog_scn.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ async def print_team(self, ctx, team):
await ctx.channel.send(msg)


def format_team(self, team):
def format_team(self, team) -> str:
# single line format: teamname: member1, member2
if team:
skip_teams = ["blocked", "users"]

if team and team.name not in skip_teams:
return f"**{team.name}**: {', '.join([user.name for user in team.users])}\n"
else:
return ""
5 changes: 5 additions & 0 deletions test_cog_scn.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ async def test_team_join_leave(self):
await self.cog.teams(ctx, test_team_name)
self.assertNotIn(self.user.name, str(ctx.respond.call_args))

# ticket-1036: confirm teams "blocked", "users" and "test-team" is not included
ctx = self.build_context()
await self.cog.teams(ctx)
for ignored_team in ["blocked", "users"]:
self.assertNotIn(ignored_team, str(ctx.respond.call_args))

async def test_thread_sync(self):
ticket = self.create_test_ticket()
Expand Down

0 comments on commit f44aa53

Please sign in to comment.