def _on_submit_review_data(self, spawn_helper, review_json, app, callback):
     """ called when submit_review finished, when the review was send
         successfully the callback is triggered with the new reviews
     """
     LOG.debug("_on_submit_review_data")
     # read stdout from submit_review
     review = ReviewDetails.from_dict(review_json)
     # FIXME: ideally this would be stored in ubuntu-sso-client
     #        but it dosn't so we store it here
     save_person_to_config(review.reviewer_username)
     if not app in self._reviews:
         self._reviews[app] = []
     self._reviews[app].insert(0, Review.from_piston_mini_client(review))
     callback(app, self._reviews[app])
Beispiel #2
0
 def _on_submit_review_data(self, spawn_helper, review_json, app):
     """ called when submit_review finished, when the review was send
         successfully the callback is triggered with the new reviews
     """
     LOG.debug("_on_submit_review_data")
     # read stdout from submit_review
     review = ReviewDetails.from_dict(review_json)
     # FIXME: ideally this would be stored in ubuntu-sso-client
     #        but it doesn't so we store it here
     save_person_to_config(review.reviewer_username)
     if not app in self._reviews:
         self._reviews[app] = []
     self._reviews[app].insert(0, Review.from_piston_mini_client(review))
     self.emit("get-reviews-finished", app, self._reviews[app])
Beispiel #3
0
 def test_save_person_to_config(self):
     from softwarecenter.utils import (save_person_to_config,
                                       get_person_from_config)
     save_person_to_config("meep")
     self.assertEqual(get_person_from_config(), "meep")
Beispiel #4
0
    def test_save_person_to_config(self):
        from softwarecenter.utils import save_person_to_config, get_person_from_config

        save_person_to_config("meep")
        self.assertEqual(get_person_from_config(), "meep")