aboutsummaryrefslogtreecommitdiffstats
path: root/tests/samplebinding/filter_test.py
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-03-29 17:26:57 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:15:19 -0300
commitc5fd9d9dbb33bc4ddbf68315d6b15dc274f076cd (patch)
tree7795da56d99a417d6ec3cc087e8a3eeaae43b1da /tests/samplebinding/filter_test.py
parent7c35c7788ab02d2d77cbc022d6cf181e7542d995 (diff)
Tests for reverse operators
CPython calls nb_and with swapped arguments for reverse operators. This tests checks if the reverse operator raises NotImplementedError instead of TypeError when there isn't a valid reverse operator. Raising TypeError would cause the operator to fail.
Diffstat (limited to 'tests/samplebinding/filter_test.py')
-rw-r--r--tests/samplebinding/filter_test.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/samplebinding/filter_test.py b/tests/samplebinding/filter_test.py
new file mode 100644
index 000000000..54da810cc
--- /dev/null
+++ b/tests/samplebinding/filter_test.py
@@ -0,0 +1,18 @@
+
+import unittest
+
+from sample import Data, Intersection, Union
+
+class TestFilters(unittest.TestCase):
+
+ def testAnd(self):
+
+ f1 = Data(Data.Name, "joe")
+ f2 = Union()
+
+ inter = f1 & f2
+
+ self.assertEqual(type(inter), Intersection)
+
+if __name__ == '__main__':
+ unittest.main()