1. Nam Nguyen
  2. intfprgm

Commits

Nam Nguyen  committed 855149a

Update test to ensure docstring does not affect ``abstract``.

  • Participants
  • Parent commits 27f8548
  • Branches default

Comments (0)

Files changed (1)

File intfprgm/tests.py

View file
  • Ignore whitespace
 
 from intfprgm import interface, abstract, concrete
 
+
 class InterfaceTest(unittest.TestCase):
 
     def test_init(self):
         self.assertRaises(SyntaxError, interface, test1)
         interface(test2)
 
+
 class AbstractTest(unittest.TestCase):
 
     def test_init(self):
         self.assertRaises(SyntaxError, abstract, test)
 
     def test_okay(self):
-        class test:
+        class test1:
             def method(self):
                 raise NotImplementedError
-        abstract(test)
+        abstract(test1)
+
+        class test2:
+            def method(self):
+                '''doctring'''
+                raise NotImplementedError
+        abstract(test2)
+
+        class test3:
+            def method(self):
+                raise NotImplementedError()
+        abstract(test3)
+
+        class test4:
+            def method(self):
+                '''docstring'''
+                raise NotImplementedError()
+        abstract(test4)
 
     def test_function(self):
         @abstract