add a test for instantiating Encoder with absent arguments
authorzooko <zooko@zooko.com>
Fri, 25 Jul 2008 17:26:00 +0000 (22:56 +0530)
committerzooko <zooko@zooko.com>
Fri, 25 Jul 2008 17:26:00 +0000 (22:56 +0530)
darcs-hash:dfec6b0ed248ec65732c9bfdfeff84ff14dd0bed

zfec/zfec/test/test_zfec.py

index 7ed3c13ea47a2dc41bf90ea5838a3454cd45702c..31c9a02b4012889c5cfc70fc7386554091141f4f 100755 (executable)
@@ -79,6 +79,16 @@ def _help_test_random_with_l_easy(l):
     _h_easy(k, m, s)
 
 class ZFecTest(unittest.TestCase):
+    def test_instantiate_no_args(self):
+        try:
+            e = zfec.Encoder()
+        except TypeError:
+            # Okay, so that's because we're required to pass constructor args.
+            pass
+        else:
+            # Oops, it should have raised an exception.
+            self.fail("Should have raised exception from incorrect arguments to constructor.")
+
     def test_from_agl_c(self):
         self.failUnless(zfec._fec.test_from_agl())