~clint-fewbar/txaws/fix-keyerror

« back to all changes in this revision

Viewing changes to txaws/server/tests/test_schema.py

  • Committer: Free Ekanayaka
  • Date: 2012-06-11 12:27:33 UTC
  • Revision ID: free.ekanayaka@canonical.com-20120611122733-1s908ijlclj18jnp
Support __contains__ in txaws.server.schema.Arguments [trivial] [r=therve]

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        arguments = Arguments({})
43
43
        self.assertRaises(KeyError, arguments.__getitem__, 1)
44
44
 
 
45
    def test_contains(self):
 
46
        """
 
47
        The presence of a certain argument can be inspected using the 'in'
 
48
        keyword.
 
49
        ."""
 
50
        arguments = Arguments({"foo": 1})
 
51
        self.assertIn("foo", arguments)
 
52
        self.assertNotIn("bar", arguments)
 
53
 
45
54
    def test_len(self):
46
55
        """C{len()} can be used with an L{Arguments} instance."""
47
56
        self.assertEqual(0, len(Arguments({})))