1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
1
# Copyright (C) 2008-2011, 2016 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
31
31
def test_list_alias_with_none(self):
32
32
"""Calling alias with no parameters lists existing aliases."""
33
33
out, err = self.run_bzr('alias')
34
self.assertEquals('', out)
34
self.assertEqual('', out)
36
36
def test_list_unknown_alias(self):
37
37
out, err = self.run_bzr('alias commit')
38
self.assertEquals('bzr alias: commit: not found\n', out)
38
self.assertEqual('bzr alias: commit: not found\n', out)
40
40
def test_add_alias_outputs_nothing(self):
41
41
out, err = self.run_bzr('alias commit="commit --strict"')
42
self.assertEquals('', out)
42
self.assertEqual('', out)
44
44
def test_add_alias_visible(self):
45
45
"""Adding an alias makes it ..."""
46
46
self.run_bzr('alias commit="commit --strict"')
47
47
out, err = self.run_bzr('alias commit')
48
self.assertEquals('bzr alias commit="commit --strict"\n', out)
48
self.assertEqual('bzr alias commit="commit --strict"\n', out)
50
50
def test_unicode_alias(self):
51
51
"""Unicode aliases should work (Bug #529930)"""
63
63
u'[ALIASES]\nust=st %s\n' % (file_name,), save=True)
65
65
out, err = self.run_bzr('ust')
66
self.assertEquals(err, '')
67
self.assertEquals(out, '')
66
self.assertEqual(err, '')
67
self.assertEqual(out, '')
69
69
def test_alias_listing_alphabetical(self):
70
70
self.run_bzr('alias commit="commit --strict"')
72
72
self.run_bzr('alias add="add -q"')
74
74
out, err = self.run_bzr('alias')
76
76
'bzr alias add="add -q"\n'
77
77
'bzr alias commit="commit --strict"\n'
78
78
'bzr alias ll="log --short"\n',
81
81
def test_remove_unknown_alias(self):
82
82
out, err = self.run_bzr('alias --remove fooix', retcode=3)
83
self.assertEquals('bzr: ERROR: The alias "fooix" does not exist.\n',
83
self.assertEqual('bzr: ERROR: The alias "fooix" does not exist.\n',
86
86
def test_remove_known_alias(self):
87
87
self.run_bzr('alias commit="commit --strict"')
88
88
out, err = self.run_bzr('alias commit')
89
self.assertEquals('bzr alias commit="commit --strict"\n', out)
89
self.assertEqual('bzr alias commit="commit --strict"\n', out)
90
90
# No output when removing an existing alias.
91
91
out, err = self.run_bzr('alias --remove commit')
92
self.assertEquals('', out)
92
self.assertEqual('', out)
94
94
out, err = self.run_bzr('alias commit')
95
self.assertEquals("bzr alias: commit: not found\n", out)
95
self.assertEqual("bzr alias: commit: not found\n", out)