Commits

Scott Smerchek  committed efc05ab

added test for each() method to test.py

  • Participants
  • Parent commits 7b09db7

Comments (0)

Files changed (1)

File pyquery/test.py

         assert len(self.klass('#node2', self.html).find('span')) == 2
         assert len(self.klass('div', self.html).find('span')) == 3
 
+    def test_each(self):
+        doc = self.klass(self.html)
+        doc('span').each(lambda e: e.wrap("<em></em>"))
+        assert len(doc('em')) == 3
+
     def test_map(self):
         def ids_minus_one(i, elem):
             return int(self.klass(elem).attr('id')[-1]) - 1