# -*- coding: utf8 -*-
"""
Tests for pika.spec

"""
import unittest

from pika import spec


class BasicPropertiesTests(unittest.TestCase):
    def test_equality(self):
        a = spec.BasicProperties(content_type='text/plain')
        self.assertEqual(a, a)
        self.assertNotEqual(a, None)

        b = spec.BasicProperties()
        self.assertNotEqual(a, b)
        b.content_type = 'text/plain'
        self.assertEqual(a, b)

        a.correlation_id = 'abc123'
        self.assertNotEqual(a, b)

        b.correlation_id = 'abc123'
        self.assertEqual(a, b)

Add explicit BasicProperties equality test
Add explicit BasicProperties equality test

In Python equality of objects, if not defined otherwise, is based on the
objects hash.
By extending amqp_objects with an __eq__ method we can now test equality
of two BasicProperties objects and can expect True if their internal
__dict__'s are equal.
