コード例 #1
0
 def test_01_cud(self):
     # get listener
     assert EventListener.get(self.pulp, self.el.id) == self.el, 'failed fetching %s' % self.el
     # list listeners
     assert self.el in EventListener.list(self.pulp), 'failed listing %s' % self.el
     # assert updating works
     self.el.update(self.pulp, {'event_types': ['repo.sync.finish', 'repo.sync.start']})
     self.assertPulpOK()
     self.el.reload(self.pulp)
     assert sorted(self.el.data['event_types']) == \
             sorted(['repo.sync.finish', 'repo.sync.start']), 'update failed: %s' % self.el
コード例 #2
0
 def test_01_cud(self):
     # instantiate default http listener
     el0 = EventListener.http(self.bin.url)
     response = el0.create(self.pulp)
     self.assertPulpOK()
     # update the listener
     with deleting(self.pulp, EventListener.from_response(response)) as el1:
         # get listener
         assert EventListener.get(self.pulp,
                                  el1.id) == el1, 'failed fetching %s' % el1
         # list listeners
         assert el1 in EventListener.list(
             self.pulp), 'failed listing %s' % el1
         # assert updating works
         el1.update(
             self.pulp,
             {'event_types': ['repo.sync.finish', 'repo.sync.start']})
         self.assertPulpOK()
         el1.reload(self.pulp)
         assert sorted(el1.data['event_types']) == \
                     sorted(['repo.sync.finish', 'repo.sync.start']), 'update failed: %s' % el1