def test_parse_three_items(self): self.assertEqual( IrcMessageTagsReadOnly.parseTags( 'Kappa=Kippa;BibleThump;FrankerZ=RalpherZ'), { 'Kappa': 'Kippa', 'BibleThump': True, 'FrankerZ': 'RalpherZ' })
def test_parse_twitch_tags(self): items = IrcMessageTagsReadOnly.parseTags('''\ badges=broadcaster/1;color=;display-name=BotGotsThis;emote-sets=0;mod=0;\ subscriber=0;turbo=0;user-type=''') self.assertEqual(items['badges'], 'broadcaster/1') self.assertEqual(items['color'], '') self.assertEqual(items['display-name'], 'BotGotsThis') self.assertEqual(items['emote-sets'], '0') self.assertEqual(items['mod'], '0') self.assertEqual(items['subscriber'], '0') self.assertEqual(items['turbo'], '0') self.assertEqual(items['user-type'], '')
def test_parse_twitch_bits(self): IrcMessageTagsReadOnly.parseTags('''\ badges=staff/1,bits/1000;bits=100;color=;display-name=TWITCH_UserNaME;emotes=;\ id=b34ccfc7-4977-403a-8a94-33c6bac34fb8;mod=0;room-id=1337;subscriber=0;\ turbo=1;user-id=1337;user-type=staff''')
def test_parse_key_value(self): self.assertEqual(IrcMessageTagsReadOnly.parseTags('Kappa=Kippa'), {'Kappa': 'Kippa'})
def test_parse_key_vendor(self): self.assertEqual(IrcMessageTagsReadOnly.parseTags('Kappa/Keepo'), {'Kappa/Keepo': True})
def test_parse_key(self): items = IrcMessageTagsReadOnly.parseTags('Kappa') self.assertEqual(items, {'Kappa': True})
def test_parse_empty(self): items = IrcMessageTagsReadOnly.parseTags('') self.assertIsInstance(items, Dict) self.assertEqual(items, IrcMessageTagsReadOnly())