~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__static_tuple.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-03 03:58:26 UTC
  • mfrom: (4668.1.5 2.1.0b2)
  • Revision ID: pqm@pqm.ubuntu.com-20091103035826-tr4qa6fznzmirgiq
(jam) Merge 2.1.0b2 (-final) to bzr.dev

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)