~noskcaj/ubuntu/vivid/webtest/merge2

« back to all changes in this revision

Viewing changes to tests/compat.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski, Jakub Wilk, Piotr Ożarowski
  • Date: 2013-10-02 19:37:14 UTC
  • mfrom: (1.2.1) (14.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20131002193714-t0na13dhqrskvvff
Tags: 2.0.9-1
[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

[ Piotr Ożarowski ]
* New upstream release
  - bump minimum required Python version to 2.6
  - add python-six, python-waitress and python-bs4 to Depends
  - remove python-pastescript from Depends
  - remove python-simplejson and python-beautifulsoup from Recommends
  - add python-pyquery to Recommends
* Update debian/watch file to check for zip files
* Standards-Version bumped to 3.9.4 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- coding: utf-8 -*-
2
 
import sys
3
2
 
4
3
try:
5
4
    # py < 2.7
10
9
try:
11
10
    unicode()
12
11
except NameError:
13
 
    u = str
14
12
    b = bytes
 
13
    def u(value):
 
14
        if isinstance(value, bytes):
 
15
            return value.decode('utf-8')
 
16
        return value
15
17
else:
16
18
    def b(value):
17
19
        return str(value)
19
21
        if isinstance(value, unicode):
20
22
            return value
21
23
        return unicode(value, 'utf-8')
22
 
 
23
 
 
24
 
if sys.version_info[:1] < (2, 6):
25
 
    def assertIn(self, x, y, c=None):
26
 
        assert x in y
27
 
 
28
 
    unittest.TestCase.assertIn = assertIn