File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -88,25 +88,23 @@ def is_satisfied_by(self, candidate):
88
88
89
89
90
90
def main ():
91
- print ( 'Specification' )
92
- andrey = User ()
93
- ivan = User (super_user = True )
94
- vasiliy = 'not User instance'
91
+ """
92
+ >>> andrey = User()
93
+ >>> ivan = User(super_user=True)
94
+ >>> vasiliy = 'not User instance'
95
95
96
- root_specification = UserSpecification ().and_specification (SuperUserSpecification ())
96
+ >>> root_specification = UserSpecification().and_specification(SuperUserSpecification())
97
97
98
- print (root_specification .is_satisfied_by (andrey ))
99
- print (root_specification .is_satisfied_by (ivan ))
100
- print (root_specification .is_satisfied_by (vasiliy ))
98
+ # Is specification satisfied by <name>
99
+ >>> root_specification.is_satisfied_by(andrey), 'andrey'
100
+ (False, 'andrey')
101
+ >>> root_specification.is_satisfied_by(ivan), 'ivan'
102
+ (True, 'ivan')
103
+ >>> root_specification.is_satisfied_by(vasiliy), 'vasiliy'
104
+ (False, 'vasiliy')
105
+ """
101
106
102
107
103
108
if __name__ == '__main__' :
104
- main ()
105
-
106
-
107
- OUTPUT = """
108
- Specification
109
- False
110
- True
111
- False
112
- """
109
+ import doctest
110
+ doctest .testmod ()
You can’t perform that action at this time.
0 commit comments