Commits

jpellerin  committed d80e96a

Added test case for attrib plugin

  • Participants
  • Parent commits 112c7d2

Comments (0)

Files changed (1)

File nose2/tests/test_attrib_plugin.py

+import unittest2
+
+from ..plugins import attrib
+
+
+class TestAttribPlugin(unittest2.TestCase):
+    tags = ['unit']
+
+    def setUp(self):
+        class TC_1(unittest2.TestCase):
+            tags = ['a, b']
+            def test_a(self):
+                pass
+            test_a.a = 1
+
+            def test_b(self):
+                pass
+            test_b.b = 1
+        self.TC_1 = TC_1
+        self.plugin = attrib.AttributeSelector()
+
+    def test_validate_attribs(self):
+        assert self.plugin.validateAttrib(
+            self.TC_1('test_a'), [[('a', '1')]])
+        assert not self.plugin.validateAttrib(
+            self.TC_1('test_a'), [[('b', '1')]])
+