* TestProtocol2's tag tests were set sort order dependent.
authorRobert Collins <robertc@robertcollins.net>
Fri, 23 Aug 2013 20:53:03 +0000 (08:53 +1200)
committerRobert Collins <robertc@robertcollins.net>
Fri, 23 Aug 2013 20:53:03 +0000 (08:53 +1200)
  (Robert Collins, #1025392)

NEWS
python/subunit/tests/test_test_protocol2.py

diff --git a/NEWS b/NEWS
index d03cc4c5e9cffc8ed635d4469cc6b95190ed6acc..fbbf4b4adf0d07509b6c5dc7205a322bf78f0021 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,12 @@ subunit release notes
 NEXT (In development)
 ---------------------
 
+BUG FIXES
+~~~~~~~~~
+
+* TestProtocol2's tag tests were set sort order dependent.
+  (Robert Collins, #1025392)
+
 0.0.13
 ------
 
index 001453922343302a2192fca7ec15ab9bada90817..ded56b8616303b47656ab85523eb7d3db97cfb28 100644 (file)
@@ -18,7 +18,7 @@ from io import BytesIO
 import datetime
 
 from testtools import TestCase
-from testtools.matchers import HasLength
+from testtools.matchers import Contains, HasLength
 from testtools.tests.test_testresult import TestStreamResultContract
 from testtools.testresult.doubles import StreamResult
 
@@ -38,7 +38,10 @@ CONSTANT_MIME = b'\xb3! #\x1aapplication/foo; charset=1x3Q\x15'
 CONSTANT_TIMESTAMP = b'\xb3+\x03\x13<\x17T\xcf\x80\xaf\xc8\x03barI\x96>-'
 CONSTANT_ROUTE_CODE = b'\xb3-\x03\x13\x03bar\x06source\x9cY9\x19'
 CONSTANT_RUNNABLE = b'\xb3(\x03\x0c\x03foo\xe3\xea\xf5\xa4'
-CONSTANT_TAGS = b'\xb3)\x80\x15\x03bar\x02\x03foo\x03barTHn\xb4'
+CONSTANT_TAGS = [
+    b'\xb3)\x80\x15\x03bar\x02\x03foo\x03barTHn\xb4',
+    b'\xb3)\x80\x15\x03bar\x02\x03bar\x03foo\xf8\xf1\x91o',
+    ]
 
 
 class TestStreamResultToBytesContract(TestCase, TestStreamResultContract):
@@ -202,7 +205,7 @@ class TestStreamResultToBytes(TestCase):
     def test_tags(self):
         result, output = self._make_result()
         result.status(test_id="bar", test_tags=set(['foo', 'bar']))
-        self.assertEqual(CONSTANT_TAGS, output.getvalue())
+        self.assertThat(CONSTANT_TAGS, Contains(output.getvalue()))
 
     def test_timestamp(self):
         timestamp = datetime.datetime(2001, 12, 12, 12, 59, 59, 45,
@@ -357,7 +360,7 @@ class TestByteStreamToStreamResult(TestCase):
             test_status='success', runnable=False)
 
     def test_tags(self):
-        self.check_event(CONSTANT_TAGS,
+        self.check_event(CONSTANT_TAGS[0],
             None, tags=set(['foo', 'bar']), test_id="bar")
 
     def test_timestamp(self):