1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-28 08:38:44 +02:00

Fixed tests.

This commit is contained in:
Jakub Roztočil 2012-03-04 11:58:23 +01:00
parent f4dde9d9b3
commit a44ef6c443
2 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ python:
- 2.7
# TODO: Python 3
#- 3.2
script: python setup.py test
script: python tests.py
install:
- pip install requests pygments
- "if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install argparse; fi"

View File

@ -30,18 +30,18 @@ class BaseTest(unittest.TestCase):
def assertNotIn(self, member, container, msg=None):
sup = super(BaseTest, self)
if hasattr('sup', 'assertNotIn'):
sup.assertIn(member, container, msg)
if hasattr(sup, 'assertNotIn'):
sup.assertNotIn(member, container, msg)
else:
self.assert_(member not in container, msg)
def assertDictEqual(self, d1, d2, msg=None):
sup = super(BaseTest, self)
if hasattr('sup', 'assertDictEqual'):
self.assertDictEqual(d1, d2, msg)
if hasattr(sup, 'assertDictEqual'):
sup.assertDictEqual(d1, d2, msg)
else:
sup.assertEqual(set(d1.keys()), set(d2.keys()), msg)
sup.assertEqual(sorted(d1.values()), sorted(d2.values()), msg)
self.assertEqual(set(d1.keys()), set(d2.keys()), msg)
self.assertEqual(sorted(d1.values()), sorted(d2.values()), msg)
class TestItemParsing(BaseTest):