예제 #1
0
 def test_head(self):
     fp = FeedPipe().cat(['tests/eg.xml']).head(2)
     a = fp.as_atom_obj()
     self.assertEqual(a.entries[0].title.text,
                      'Migrating My Blog from Linode to CloudFront')
     self.assertEqual(a.entries[1].title.text, 'UCSPI')
     self.assertEqual(fp.count(), 2)
예제 #2
0
 def test_head(self):
     fp = FeedPipe().cat(['tests/eg.xml']).head(2)
     a = fp.as_atom_obj()
     self.assertEqual(a.entries[0].title.text,
                      'Migrating My Blog from Linode to CloudFront')
     self.assertEqual(a.entries[1].title.text, 'UCSPI')
     self.assertEqual(fp.count(), 2)
예제 #3
0
 def test_grep(self):
     fp = FeedPipe() \
             .cat(['./tests/eg.xml']) \
             .grep(lambda e: 'e' in e.title.text)
     a = fp.as_atom_obj()
     self.assertEqual(a.entries[0].title.text,
                      'Migrating My Blog from Linode to CloudFront')
     self.assertEqual(a.entries[1].title.text,
                      'Checking sudoers with visudo in SaltStack')
     self.assertEqual(fp.count(), 5)
예제 #4
0
 def test_grep(self):
     fp = FeedPipe() \
             .cat(['./tests/eg.xml']) \
             .grep(lambda e: 'e' in e.title.text)
     a = fp.as_atom_obj()
     self.assertEqual(
         a.entries[0].title.text,
         'Migrating My Blog from Linode to CloudFront'
     )
     self.assertEqual(
         a.entries[1].title.text,
         'Checking sudoers with visudo in SaltStack'
     )
     self.assertEqual(fp.count(), 5)
예제 #5
0
 def test_tail(self):
     fp = FeedPipe().cat(['tests/eg.xml']).tail(2)
     a = fp.as_atom_obj()
     self.assertEqual(a.entries[0].title.text, 'PID Namespaces in Linux')
     self.assertEqual(a.entries[1].title.text, 'Dream On Dreamer')
     self.assertEqual(fp.count(), 2)
예제 #6
0
 def test_tail(self):
     fp = FeedPipe().cat(['tests/eg.xml']).tail(2)
     a = fp.as_atom_obj()
     self.assertEqual(a.entries[0].title.text, 'PID Namespaces in Linux')
     self.assertEqual(a.entries[1].title.text, 'Dream On Dreamer')
     self.assertEqual(fp.count(), 2)