コード例 #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
ファイル: test_tasks.py プロジェクト: potch/zamboni
 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
ファイル: test_tasks.py プロジェクト: srachit/olympia
 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
ファイル: test_tasks.py プロジェクト: srachit/olympia
 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
ファイル: test_tasks.py プロジェクト: atassumer/zamboni
 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
ファイル: test_tasks.py プロジェクト: potch/zamboni
 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
ファイル: test_tasks.py プロジェクト: tmp0230/zamboni
 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)