1
# Copyright (C) 2011 Curtis Hovey <sinzui.is@verizon.net>
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.
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.
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
17
"""Test the AvatarsBox functionality."""
23
from bzrlib.plugins.gtk.avatarsbox import Avatar
26
class TestAvatar(tests.TestCase):
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)
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)
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)