/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_avatarsbox.py

  • Committer: Mark Lee
  • Date: 2009-07-10 20:07:43 UTC
  • mto: This revision was merged to the branch mainline in revision 661.
  • Revision ID: bzr@lazymalevolence.com-20090710200743-2s9x0xa8jgs9wf8s
Remove credits.pickle (generated file).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2011 Curtis Hovey <sinzui.is@verizon.net>
2
 
#
3
 
# This program is free software; you can redistribute it and/or modify
4
 
# it under the terms of the GNU General Public License as published by
5
 
# the Free Software Foundation; either version 2 of the License, or
6
 
# (at your option) any later version.
7
 
#
8
 
# This program is distributed in the hope that it will be useful,
9
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
# GNU General Public License for more details.
12
 
#
13
 
# You should have received a copy of the GNU General Public License
14
 
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 
 
17
 
"""Test the AvatarsBox functionality."""
18
 
 
19
 
from bzrlib import (
20
 
    tests,
21
 
    )
22
 
 
23
 
from bzrlib.plugins.gtk.avatarsbox import Avatar
24
 
 
25
 
 
26
 
class TestAvatar(tests.TestCase):
27
 
 
28
 
    def test__init(self):
29
 
        apparent_username = 'Random J User <randomjuser@eg.dom>'
30
 
        avatar = Avatar(apparent_username)
31
 
        self.assertEqual(apparent_username, avatar.apparent_username)
32
 
        self.assertEqual('Random J User', avatar.username)
33
 
        self.assertEqual('randomjuser@eg.dom', avatar.email)
34
 
        self.assertEqual(None, avatar.image)
35
 
 
36
 
    def test_eq_true(self):
37
 
        apparent_username = 'Random J User <randomjuser@eg.dom>'
38
 
        avatar_1 = Avatar(apparent_username)
39
 
        avatar_2 = Avatar(apparent_username)
40
 
        self.assertTrue(avatar_1 == avatar_2)
41
 
 
42
 
    def test_eq_false(self):
43
 
        apparent_username = 'Random J User <randomjuser@eg.dom>'
44
 
        avatar_1 = Avatar(apparent_username)
45
 
        avatar_2 = Avatar(apparent_username)
46
 
        avatar_2.username = 'changed'
47
 
        self.assertFalse(avatar_1 == avatar_2)