Skip to content

Commit c552d04

Browse files
committed
Add/correct docstrings
1 parent 7069c47 commit c552d04

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python3/jute/test/test_jute.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class FooBaz(Foo):
2020
def baz(self):
2121
"""The baz method."""
2222

23+
2324
class IncompleteProviderTestsMixin:
2425

2526
# Change this to the class to be tested
@@ -67,8 +68,8 @@ class CompleteProviderTestsMixin:
6768
HasFooBarBaz = object
6869

6970
def test_provide(self):
70-
# An interface only has attributes defined in interface (and in
71-
# sub-interfaces).
71+
"""An interface only has attributes defined in the interface (or
72+
in super-interfaces)."""
7273
obj = self.HasFooBarBaz()
7374
foobar = FooBar(obj)
7475
self.assertEqual(foobar.foo, 1)
@@ -79,6 +80,7 @@ def test_provide(self):
7980
self.assertEqual(obj.foo, 2)
8081

8182
def test_inherit(self):
83+
"""An interface can be mapped to a super-interface."""
8284
obj = self.HasFooBarBaz()
8385
foobar = FooBar(obj)
8486
foo = Foo(foobar)
@@ -88,6 +90,8 @@ def test_inherit(self):
8890
self.assertEqual(obj.foo, 1)
8991

9092
def test_upcast_fails(self):
93+
"""An interface cannot be mapped to a sub-interface, even if the
94+
wrapped instance could be."""
9195
obj = self.HasFooBarBaz()
9296
foo = Foo(obj)
9397
with self.assertRaises(TypeError):
@@ -115,6 +119,7 @@ def test_wrapped_duck_fails(self):
115119
FooBaz(foobar)
116120

117121
def test_subclass_provider_provides_interface(self):
122+
"""Subclassing an implementation and a provider works."""
118123
class FooBarBazSubclass(self.HasFooBarBaz, FooBaz.Provider):
119124
pass
120125
obj = FooBarBazSubclass()
@@ -127,6 +132,7 @@ class FooBarBazSubclass(self.HasFooBarBaz, FooBaz.Provider):
127132
self.assertEqual(obj.foo, 3)
128133

129134
def test_provider_subclass_provides_interface(self):
135+
"""Subclassing a provider and an implementation works."""
130136
class FooBarBazSubclass(FooBaz.Provider, self.HasFooBarBaz):
131137
pass
132138
obj = FooBarBazSubclass()

0 commit comments

Comments
 (0)