-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7-base_geometry.txt
75 lines (62 loc) · 1.84 KB
/
7-base_geometry.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Doctest for the BaseGeometry class and its methods
---------------------------------------------------
Import .py module:
>>> BaseGeometry = __import__('7-base_geometry').BaseGeometry
>>> bg = BaseGeometry()
Method area:
>>> bg.area()
Traceback (most recent call last):
...
Exception: area() is not implemented
Basic use:
>>> bg.integer_validator("age", 1)
Zero value:
>>> bg.integer_validator("age", 0)
Traceback (most recent call last):
...
ValueError: age must be greater than 0
Negative value:
>>> bg.integer_validator("age", -4)
Traceback (most recent call last):
...
ValueError: age must be greater than 0
String value:
>>> bg.integer_validator("age", "4")
Traceback (most recent call last):
...
TypeError: age must be an integer
Tuple value:
>>> bg.integer_validator("age", (4,))
Traceback (most recent call last):
...
TypeError: age must be an integer
List value:
>>> bg.integer_validator("age", [3])
Traceback (most recent call last):
...
TypeError: age must be an integer
Bool value:
>>> bg.integer_validator("age", True)
Traceback (most recent call last):
...
TypeError: age must be an integer
Set value:
>>> bg.integer_validator("age", {3, 4})
Traceback (most recent call last):
...
TypeError: age must be an integer
None value:
>>> bg.integer_validator("age", None)
Traceback (most recent call last):
...
TypeError: age must be an integer
One argument:
>>> bg.integer_validator("age")
Traceback (most recent call last):
...
TypeError: integer_validator() missing 1 required positional argument: 'value'
No arguments:
>>> bg.integer_validator()
Traceback (most recent call last):
...
TypeError: integer_validator() missing 2 required positional arguments: 'name' and 'value'