~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_rio.py

  • Committer: Martin Pool
  • Date: 2006-02-17 20:44:17 UTC
  • mto: This revision was merged to the branch mainline in revision 1569.
  • Revision ID: mbp@sourcefrog.net-20060217204417-fb97e1eb0e03ee38
rio.Stanza.add should raise TypeError on invalid types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005, 2006 by Canonical Ltd
2
2
#
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
280
280
        """Write empty stanza"""
281
281
        l = list(Stanza().to_lines())
282
282
        self.assertEquals(l, [])
 
283
 
 
284
    def test_rio_raises_type_error(self):
 
285
        """TypeError on adding invalid type to Stanza"""
 
286
        s = Stanza()
 
287
        self.assertRaises(TypeError, s.add, 'foo', {})
 
288
 
 
289
    def test_rio_raises_type_error_key(self):
 
290
        """TypeError on adding invalid type to Stanza"""
 
291
        s = Stanza()
 
292
        self.assertRaises(TypeError, s.add, 10, {})