~ubuntu-branches/ubuntu/utopic/gozerbot/utopic

« back to all changes in this revision

Viewing changes to plugtests/test_ipv6.py

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Malcolm
  • Date: 2009-09-14 09:00:29 UTC
  • mfrom: (1.1.4 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090914090029-uval0ekt72kmklxw
Tags: 0.9.1.3-3
Changed dependency on python-setuptools to python-pkg-resources
(Closes: #546435) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# tests/test_ipv6.py
2
 
#
3
 
#
4
 
 
5
 
__copyright__ = 'this file is in the public domain'
6
 
 
7
 
from gozerbot.ircevent import Ircevent
8
 
from gozerbot.bot import Bot
9
 
from gozerbot.generic import getwho
10
 
from gozerbot.config import config
11
 
import unittest, time
12
 
 
13
 
class test_ipv6(unittest.TestCase):
14
 
    b = Bot('bla')
15
 
 
16
 
    def test_ipv6_userhost(self):
17
 
        ii = Ircevent().parse(self.b, ':qqa!~qqa@2001:888:1218:2180:0:0:0:aaaf \
18
 
PRIVMSG #bartbot :bla')
19
 
        self.assertEqual(ii.userhost, 'qqa@2001:888:1218:2180:0:0:0:aaaf')
20
 
 
21
 
    def test_ipv6_getwho(self):
22
 
        self.b.fakein(':localhost 311  bartbot dunk ~bart \
23
 
2001:888:1218:2180:0:0:0:aaaf * :bart')
24
 
        a = getwho(self.b, 'dunk')
25
 
        self.assertEqual(a, 'bart@2001:888:1218:2180:0:0:0:aaaf')
26
 
 
27
 
    def test_ipv6_getwho2(self):
28
 
        self.b.fakein(':localhost 311  bartbot dunk ~bart ::aaaf * :bart')
29
 
        a = getwho(self.b, 'dunk')
30
 
        self.assertEqual(a, 'bart@::aaaf')