Esempio n. 1
0
    def test_empty_input(self):
        """Test empty input"""
        # None input
        resp = format_slack_id(None)
        assert resp == 'UNKNOWN'

        # empty input
        resp = format_slack_id('')
        assert resp == 'UNKNOWN'
Esempio n. 2
0
 def test_team_id_passing_displayname(self):
     """Test a team id with display name"""
     resp = format_slack_id('subteam-T12345', 'Joe123')
     assert resp == 'Joe123 (<!subteam^T12345>)'
Esempio n. 3
0
 def test_team_id_missing_hyphen(self):
     """Test a team id missing a '-' as input"""
     resp = format_slack_id('subteamT12345')
     assert resp == 'subteamT12345'
Esempio n. 4
0
 def test_team_id(self):
     """Test a simple team id as input, no display name"""
     resp = format_slack_id('subteam-T12345')
     assert resp == '(see log) <!subteam^T12345>'
Esempio n. 5
0
 def test_user_id(self):
     """Test a simple user id as input"""
     resp = format_slack_id('U12345')
     assert resp == '<@U12345>'
Esempio n. 6
0
 def test_unrecognized_input(self):
     """Test unrecognized input"""
     resp = format_slack_id('BLAH')
     assert resp == 'BLAH'