[Python-modules-commits] r21574 - in packages/python-oauthlib/trunk/debian (5 files)

eriol-guest at users.alioth.debian.org eriol-guest at users.alioth.debian.org
Sat May 5 01:18:09 UTC 2012


    Date: Saturday, May 5, 2012 @ 01:18:06
  Author: eriol-guest
Revision: 21574

Enabled testing at build time

Added:
  packages/python-oauthlib/trunk/debian/patches/
  packages/python-oauthlib/trunk/debian/patches/01_ship-missing-tests.patch
  packages/python-oauthlib/trunk/debian/patches/series
Modified:
  packages/python-oauthlib/trunk/debian/control
  packages/python-oauthlib/trunk/debian/rules

Modified: packages/python-oauthlib/trunk/debian/control
===================================================================
--- packages/python-oauthlib/trunk/debian/control	2012-05-04 21:21:28 UTC (rev 21573)
+++ packages/python-oauthlib/trunk/debian/control	2012-05-05 01:18:06 UTC (rev 21574)
@@ -4,9 +4,12 @@
 Section: python
 Priority: optional
 Build-Depends:
- debhelper (>= 7),
+ debhelper (>= 7.0.50~),
  python-all (>= 2.6.6-3),
- python-setuptools (>= 0.6b3)
+ python-crypto,
+ python-nose,
+ python-setuptools (>= 0.6b3),
+ python-unittest2
 Standards-Version: 3.9.3
 X-Python-Version: >= 2.5
 Homepage: https://github.com/idangazit/oauthlib

Added: packages/python-oauthlib/trunk/debian/patches/01_ship-missing-tests.patch
===================================================================
--- packages/python-oauthlib/trunk/debian/patches/01_ship-missing-tests.patch	                        (rev 0)
+++ packages/python-oauthlib/trunk/debian/patches/01_ship-missing-tests.patch	2012-05-05 01:18:06 UTC (rev 21574)
@@ -0,0 +1,95 @@
+Description: Ship missing files required for run tests at build time.
+Origin: upstream, https://github.com/idangazit/oauthlib/tree/0.1.2/tests
+Bug: https://github.com/idangazit/oauthlib/pull/35
+Last-Update: 2012-05-05
+
+--- /dev/null
++++ b/tests/test_common.py
+@@ -0,0 +1,82 @@
++# -*- coding: utf-8 -*-
++from __future__ import absolute_import
++from oauthlib.common import *
++from .unittest import TestCase
++
++
++class CommonTests(TestCase):
++    params_dict = {u'foo': u'bar', u'baz': u'123', }
++    params_twotuple = [(u'foo', u'bar'), (u'baz', u'123')]
++    params_formencoded = u'foo=bar&baz=123'
++    uri = u'http://www.someuri.com'
++
++    def test_urldecode(self):
++        self.assertEqual(urldecode(u''), [])
++        self.assertEqual(urldecode(u'='), [(u'', u'')])
++        self.assertEqual(urldecode(u'%20'), [(u' ', u'')])
++        self.assertEqual(urldecode(u'+'), [(u' ', u'')])
++        self.assertEqual(urldecode(u'c2'), [(u'c2', u'')])
++        self.assertEqual(urldecode(u'c2='), [(u'c2', u'')])
++        self.assertEqual(urldecode(u'foo=bar'), [(u'foo', u'bar')])
++        self.assertEqual(urldecode(u'foo_%20~=.bar-'), [(u'foo_ ~', u'.bar-')])
++        self.assertRaises(ValueError, urldecode, u'foo bar')
++        self.assertRaises(ValueError, urldecode, u'?')
++        self.assertRaises(ValueError, urldecode, u'%R')
++        self.assertRaises(ValueError, urldecode, u'%RA')
++        self.assertRaises(ValueError, urldecode, u'%AR')
++        self.assertRaises(ValueError, urldecode, u'%RR')
++
++    def test_extract_params_dict(self):
++        self.assertEqual(extract_params(self.params_dict), self.params_twotuple)
++
++    def test_extract_params_twotuple(self):
++        self.assertEqual(extract_params(self.params_twotuple), self.params_twotuple)
++
++    def test_extract_params_formencoded(self):
++        self.assertEqual(extract_params(self.params_formencoded), self.params_twotuple)
++
++    def test_extract_params_blank_string(self):
++        self.assertEqual(extract_params(''), [])
++
++    def test_extract_params_empty_list(self):
++        self.assertEqual(extract_params([]), [])
++
++    def test_extract_non_formencoded_string(self):
++        self.assertEqual(extract_params('not a formencoded string'), None)
++
++    def test_extract_invalid(self):
++        self.assertEqual(extract_params(object()), None)
++
++    def test_none_body(self):
++        r = Request(self.uri)
++        self.assertEqual(r.decoded_body, None)
++
++    def test_empty_list_body(self):
++        r = Request(self.uri, body=[])
++        self.assertEqual(r.decoded_body, [])
++
++    def test_empty_dict_body(self):
++        r = Request(self.uri, body={})
++        self.assertEqual(r.decoded_body, [])
++
++    def test_empty_string_body(self):
++        r = Request(self.uri, body='')
++        self.assertEqual(r.decoded_body, [])
++
++    def test_non_formencoded_string_body(self):
++        body = 'foo bar baz la la la!'
++        r = Request(self.uri, body=body)
++        self.assertEqual(r.decoded_body, None)
++
++    def test_param_free_sequence_body(self):
++        body = [1, 1, 2, 3, 5, 8, 13]
++        r = Request(self.uri, body=body)
++        self.assertEqual(r.decoded_body, None)
++
++    def test_list_body(self):
++        r = Request(self.uri, body=self.params_twotuple)
++        self.assertEqual(r.decoded_body, self.params_twotuple)
++
++    def test_dict_body(self):
++        r = Request(self.uri, body=self.params_dict)
++        self.assertEqual(r.decoded_body, self.params_twotuple)
+--- /dev/null
++++ b/tests/__init__.py
+@@ -0,0 +1,2 @@
++# To make quilt happy and create this file.
++

Added: packages/python-oauthlib/trunk/debian/patches/series
===================================================================
--- packages/python-oauthlib/trunk/debian/patches/series	                        (rev 0)
+++ packages/python-oauthlib/trunk/debian/patches/series	2012-05-05 01:18:06 UTC (rev 21574)
@@ -0,0 +1 @@
+01_ship-missing-tests.patch

Modified: packages/python-oauthlib/trunk/debian/rules
===================================================================
--- packages/python-oauthlib/trunk/debian/rules	2012-05-04 21:21:28 UTC (rev 21573)
+++ packages/python-oauthlib/trunk/debian/rules	2012-05-05 01:18:06 UTC (rev 21574)
@@ -4,3 +4,11 @@
 
 %:
 	dh $@ --with python2
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	set -ex; \
+	for python in $(shell pyversions -r); do \
+		$$python setup.py test -vv; \
+	done
+endif




More information about the Python-modules-commits mailing list