/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__static_tuple.py

  • Committer: John Arbash Meinel
  • Date: 2009-11-05 18:36:59 UTC
  • mfrom: (4786 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4788.
  • Revision ID: john@arbash-meinel.com-20091105183659-vgrehx0r7gpr23m2
Merge bzr.dev @4786, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from bzrlib import (
24
24
    _static_tuple_py,
 
25
    debug,
25
26
    errors,
26
27
    osutils,
27
28
    static_tuple,
620
621
                return
621
622
        self.assertIs(static_tuple.StaticTuple,
622
623
                      self.module.StaticTuple)
 
624
 
 
625
 
 
626
class TestEnsureStaticTuple(tests.TestCase):
 
627
 
 
628
    def test_is_static_tuple(self):
 
629
        st = static_tuple.StaticTuple('foo')
 
630
        st2 = static_tuple.expect_static_tuple(st)
 
631
        self.assertIs(st, st2)
 
632
 
 
633
    def test_is_tuple(self):
 
634
        t = ('foo',)
 
635
        st = static_tuple.expect_static_tuple(t)
 
636
        self.assertIsInstance(st, static_tuple.StaticTuple)
 
637
        self.assertEqual(t, st)
 
638
 
 
639
    def test_flagged_is_static_tuple(self):
 
640
        debug.debug_flags.add('static_tuple')
 
641
        st = static_tuple.StaticTuple('foo')
 
642
        st2 = static_tuple.expect_static_tuple(st)
 
643
        self.assertIs(st, st2)
 
644
 
 
645
    def test_flagged_is_tuple(self):
 
646
        debug.debug_flags.add('static_tuple')
 
647
        t = ('foo',)
 
648
        self.assertRaises(TypeError, static_tuple.expect_static_tuple, t)