File: testdbc9b.py

package info (click to toggle)
python-contract 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 268 kB
  • ctags: 305
  • sloc: python: 1,159; makefile: 56
file content (17 lines) | stat: -rwxr-xr-x 377 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
"""Tests Ruben Reifenberg's invalid precondition bug.

The idea here is that a base class does not have any contract checking,
but a base class tightens the (non-existing) preconditions.

The full test is in testdbc9d.py
"""

class Base(object):
    def method(self, a):
        """Loose precondition

        pre: a > 5
        """
        return a * 9