1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Converted all unittest asserts to plain, pytest-powered asserts.

This commit is contained in:
Jakub Roztocil
2014-04-24 14:58:15 +02:00
parent 6071fff4af
commit b880e996d0
14 changed files with 313 additions and 360 deletions

View File

@@ -4,7 +4,6 @@ import time
import json
import shutil
import tempfile
import unittest
try:
from unittest import skipIf, skip
except ImportError:
@@ -26,7 +25,7 @@ sys.path.insert(0, os.path.realpath(os.path.join(TESTS_ROOT, '..')))
from httpie import ExitStatus
from httpie.models import Environment
from httpie.core import main
from httpie.compat import is_py26, bytes, str
from httpie.compat import bytes, str
def patharg(path):
@@ -39,7 +38,7 @@ HTTPBIN_URL = os.environ.get('HTTPBIN_URL',
CRLF = '\r\n'
OK = 'HTTP/1.1 200'
HTTP_OK = 'HTTP/1.1 200'
OK_COLOR = (
'HTTP\x1b[39m\x1b[38;5;245m/\x1b[39m\x1b'
'[38;5;37m1.1\x1b[39m\x1b[38;5;245m \x1b[39m\x1b[38;5;37m200'
@@ -189,22 +188,3 @@ def http(*args, **kwargs):
finally:
stdout.close()
stderr.close()
class BaseTestCase(unittest.TestCase):
maxDiff = 100000
if is_py26:
def assertIn(self, member, container, msg=None):
self.assertTrue(member in container, msg)
def assertNotIn(self, member, container, msg=None):
self.assertTrue(member not in container, msg)
def assertDictEqual(self, d1, d2, msg=None):
self.assertEqual(set(d1.keys()), set(d2.keys()), msg)
self.assertEqual(sorted(d1.values()), sorted(d2.values()), msg)
def assertIsNone(self, obj, msg=None):
self.assertEqual(obj, None, msg=msg)