Skip to content
Snippets Groups Projects
Unverified Commit cc3c6c71 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

add unit tests for Python 2.7

parent f3fe17bb
No related branches found
No related tags found
No related merge requests found
Pipeline #62159 failed with stages
in 1 minute and 41 seconds
......@@ -10,7 +10,7 @@ stages:
alias: rabbitmq
before_script:
- python setup.py install
- pip install --break-system-packages nose2 coverage requests yapf
- pip install --break-system-packages nose2 coverage requests yapf unittest2
- coverage run --append -m compile_definitions
artifacts:
paths:
......@@ -56,7 +56,7 @@ unittest_epoll_python27:
extends: .before_test
image: python:2.7
before_script:
- pip install nose2 coverage
- pip install nose2 coverage unittest2
- python setup.py install
script:
- coverage run --append -m nose2 -F -vv
......
......@@ -6,7 +6,7 @@ setup(keywords=['amqp', 'rabbitmq', 'client', 'network', 'ha', 'high availabilit
version=__version__,
packages=find_packages(include=['coolamqp', 'coolamqp.*']),
install_requires=['six'],
tests_require=["pytest", "coverage"],
tests_require=["pytest", "coverage", "unittest2"],
test_suite='nose2.collector.collector',
python_requires='!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
extras_require={
......
......@@ -7,8 +7,7 @@ from coolamqp.objects import argumentify
class TestFraming(unittest.TestCase):
def test_something(self):
def test_enframing_arguments(self):
buf = io.BytesIO()
args = argumentify({'x-match': 'all', 'format': 'pdf'})
res = enframe_table(buf, args)
print(repr(res))
enframe_table(buf, args)
# coding=UTF-8
from __future__ import print_function, absolute_import, division
import unittest
import unittest2
import sys
from coolamqp.objects import NodeDefinition, MessageProperties, Queue
class TestObjects(unittest.TestCase):
class TestObjects(unittest2.TestCase):
def test_message_properties(self):
empty_p_msg = MessageProperties()
ce_p_msg = MessageProperties(content_encoding=b'wtf')
self.assertIn('wtf', str(ce_p_msg))
@unittest.skipIf(sys.platform.startswith('2'), 'Only Python 3 has assertWarns')
def test_warning(self):
with self.assertWarns(PendingDeprecationWarning):
Queue(auto_delete=True, exclusive=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment