diff options
| author | Robert Collins <robertc@robertcollins.net> | 2012-01-11 18:42:53 +1300 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2012-01-11 18:42:53 +1300 |
| commit | 00461beb4b64db6050cc38f70122c475394df057 (patch) | |
| tree | 04463a3a6c1fa16966b0b640769919ab5373f470 /python/subunit/__init__.py | |
| parent | e314172fac2c7184587ebf196414028df397f78c (diff) | |
| download | subunit-00461beb4b64db6050cc38f70122c475394df057.tar.gz | |
Tag support has been implemented for TestProtocolClient.
(Robert Collins, #518016)
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index b4c9397..b30b8fe 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -755,6 +755,15 @@ class TestProtocolClient(testresult.TestResult): self._stream.write(self._progress_fmt + prefix + offset + self._bytes_eol) + def tags(self, new_tags, gone_tags): + """Inform the client about tags added/removed from the stream.""" + if not new_tags and not gone_tags: + return + tags = set([tag.encode('utf8') for tag in new_tags]) + tags.update([_b("-") + tag.encode('utf8') for tag in gone_tags]) + tag_line = _b("tags: ") + _b(" ").join(tags) + _b("\n") + self._stream.write(tag_line) + def time(self, a_datetime): """Inform the client of the time. |
