diff options
author | Robert Collins <robertc@robertcollins.net> | 2013-08-24 08:53:03 +1200 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2013-08-24 08:53:03 +1200 |
commit | ff0256a6772dd4a881553e48fff5cdcfb9431296 (patch) | |
tree | 80d80e487bb3b4befc1b603102a9c05981d53fca /python/subunit/tests/test_test_protocol2.py | |
parent | 20ee8e8ab4c24ef318a7b2620c28ec0dce2fd393 (diff) | |
download | subunit-git-ff0256a6772dd4a881553e48fff5cdcfb9431296.tar.gz |
* TestProtocol2's tag tests were set sort order dependent.
(Robert Collins, #1025392)
Diffstat (limited to 'python/subunit/tests/test_test_protocol2.py')
-rw-r--r-- | python/subunit/tests/test_test_protocol2.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/python/subunit/tests/test_test_protocol2.py b/python/subunit/tests/test_test_protocol2.py index 0014539..ded56b8 100644 --- a/python/subunit/tests/test_test_protocol2.py +++ b/python/subunit/tests/test_test_protocol2.py @@ -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): |