Пример #1
0
 def test_jetpack_with_older_harness_opt(self):
     file_ = self.file(builder_version=None)  # old harness options
     tasks.start_upgrade([file_.id], sdk_version='1.2')
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     eq_(args['location'], file_.get_url_path('builder'))
     assert 'package_key' not in args, ('Unexpected keys: %s' % args.keys())
Пример #2
0
 def test_jetpack_with_older_harness_opt(self):
     file_ = self.file(builder_version=None)  # old harness options
     tasks.start_upgrade([file_.id], sdk_version="1.2")
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     eq_(args["location"], file_.get_url_path("builder"))
     assert "package_key" not in args, "Unexpected keys: %s" % args.keys()
Пример #3
0
 def test_jetpack_with_older_harness_opt(self):
     file_ = self.file(builder_version=None)  # old harness options
     tasks.start_upgrade([file_.id], sdk_version='1.2')
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     eq_(args['location'], file_.get_url_path('builder'))
     assert 'package_key' not in args, (
         'Unexpected keys: %s' % args.keys())
Пример #4
0
 def test_record_action(self):
     file_ = self.file(builder_version='1234500')
     tasks.start_upgrade([file_.id], sdk_version='1.2')
     assert self.urllib2.urlopen.called
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     self.assertDictEqual(args, {
         'addon': str(3615),
         'file_id': str(file_.id),
         'priority': 'low',
         'secret': settings.BUILDER_SECRET_KEY,
         'package_key': file_.builder_version,
         'uuid': args['uuid'],  # uuid is random so steal from args.
         'pingback': absolutify(reverse('amo.builder-pingback')),
         'sdk_version': '1.2',
     })
     eq_(url, settings.BUILDER_UPGRADE_URL)
Пример #5
0
 def test_send_request(self):
     addon = Addon.objects.get(id=3615)
     File.objects.all().update(jetpack_version='0.9')
     file_ = addon.current_version.all_files[0]
     tasks.start_upgrade([file_.id])
     assert self.urllib2.urlopen.called
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     self.assertDictEqual(args, {
         'addon': str(3615),
         'file_id': str(file_.id),
         'priority': 'low',
         'secret': settings.BUILDER_SECRET_KEY,
         'location': file_.get_url_path('builder'),
         'uuid': args['uuid'],  # uuid is random so steal from args.
         'pingback': absolutify(reverse('amo.builder-pingback')),
     })
     eq_(url, settings.BUILDER_UPGRADE_URL)
Пример #6
0
 def test_send_request(self):
     file_ = self.file(builder_version='1234500')
     tasks.start_upgrade([file_.id], sdk_version='1.2')
     assert self.urllib2.urlopen.called
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     self.assertDictEqual(
         args,
         {
             'addon': str(3615),
             'file_id': str(file_.id),
             'priority': 'low',
             'secret': settings.BUILDER_SECRET_KEY,
             'package_key': file_.builder_version,
             'uuid': args['uuid'],  # uuid is random so steal from args.
             'pingback': absolutify(reverse('amo.builder-pingback')),
             'sdk_version': '1.2',
         })
     eq_(url, settings.BUILDER_UPGRADE_URL)
Пример #7
0
 def test_send_request(self):
     file_ = self.file(builder_version="1234500")
     tasks.start_upgrade([file_.id], sdk_version="1.2")
     assert self.urllib2.urlopen.called
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     self.assertDictEqual(
         args,
         {
             "addon": str(3615),
             "file_id": str(file_.id),
             "priority": "low",
             "secret": settings.BUILDER_SECRET_KEY,
             "package_key": file_.builder_version,
             "uuid": args["uuid"],  # uuid is random so steal from args.
             "pingback": absolutify(reverse("amo.builder-pingback")),
             "sdk_version": "1.2",
         },
     )
     eq_(url, settings.BUILDER_UPGRADE_URL)
Пример #8
0
 def test_send_request(self):
     addon = Addon.objects.get(id=3615)
     File.objects.all().update(jetpack_version='0.9')
     file_ = addon.current_version.all_files[0]
     tasks.start_upgrade([file_.id])
     assert self.urllib2.urlopen.called
     url, args = self.urllib2.urlopen.call_args[0]
     args = dict(urlparse.parse_qsl(args))
     self.assertDictEqual(
         args,
         {
             'addon': str(3615),
             'file_id': str(file_.id),
             'priority': 'low',
             'secret': settings.BUILDER_SECRET_KEY,
             'location': file_.get_url_path('builder'),
             'uuid': args['uuid'],  # uuid is random so steal from args.
             'pingback': absolutify(reverse('amo.builder-pingback')),
         })
     eq_(url, settings.BUILDER_UPGRADE_URL)