~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bugtracker.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
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
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
18
from bzrlib import bugtracker, errors, urlutils
19
 
from bzrlib.tests import TestCaseWithMemoryTransport
 
19
from bzrlib.tests import TestCase, TestCaseWithMemoryTransport
20
20
 
21
21
 
22
22
class TestGetBugURL(TestCaseWithMemoryTransport):
210
210
        """
211
211
        self.assertRaises(
212
212
            errors.MalformedBugIdentifier, self.tracker.get_bug_url, 'bad')
 
213
 
 
214
 
 
215
class TestPropertyEncoding(TestCase):
 
216
    """Tests for how the bug URLs are encoded as revision properties."""
 
217
 
 
218
    def test_encoding_one(self):
 
219
        self.assertEqual(
 
220
            'http://example.com/bugs/1 fixed',
 
221
            bugtracker.encode_fixes_bug_urls(['http://example.com/bugs/1']))
 
222
 
 
223
    def test_encoding_zero(self):
 
224
        self.assertEqual('', bugtracker.encode_fixes_bug_urls([]))
 
225
 
 
226
    def test_encoding_two(self):
 
227
        self.assertEqual(
 
228
            'http://example.com/bugs/1 fixed\n'
 
229
            'http://example.com/bugs/2 fixed',
 
230
            bugtracker.encode_fixes_bug_urls(
 
231
                ['http://example.com/bugs/1', 'http://example.com/bugs/2']))