<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/python-systemd.git/systemd/test/test_journal.py, branch v235</title>
<subtitle>github.com: systemd/python-systemd.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/'/>
<entry>
<title>tests: simplify imports</title>
<updated>2022-08-16T09:03:09+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2022-08-16T08:35:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=cc03ed6d2013f40c5e20efa2af8d822a47c592b2'/>
<id>cc03ed6d2013f40c5e20efa2af8d822a47c592b2</id>
<content type='text'>
'import foo as _foo' is useful in exported modules to avoid 'foo' being
present in the public API. No need to play that game in test code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'import foo as _foo' is useful in exported modules to avoid 'foo' being
present in the public API. No need to play that game in test code.
</pre>
</div>
</content>
</entry>
<entry>
<title>journal: fix compatibility with python2</title>
<updated>2022-08-16T09:03:09+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2022-08-16T08:34:10+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=872ce304a07bb4c1b4fc06b7bfbd9220652c3793'/>
<id>872ce304a07bb4c1b4fc06b7bfbd9220652c3793</id>
<content type='text'>
This is a lazy workaround: 4c9a241949067fc8d55f3ea12170ad364bd8b18d
is amended to do nothing on python2, so we have the same issue that
was present before. This allows the code to execute, and hopefully
almost nobody is using python2 code anyway.

f868a56b935b6152d611b22f7a5538f14dafb194 is amended in the same way.
For python2 code we have the same lack of timezone-awareness as before.

This allows the tests to pass under python 2.7.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a lazy workaround: 4c9a241949067fc8d55f3ea12170ad364bd8b18d
is amended to do nothing on python2, so we have the same issue that
was present before. This allows the code to execute, and hopefully
almost nobody is using python2 code anyway.

f868a56b935b6152d611b22f7a5538f14dafb194 is amended in the same way.
For python2 code we have the same lack of timezone-awareness as before.

This allows the tests to pass under python 2.7.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adding timezone information to datetimes from systemd-journal</title>
<updated>2022-08-13T17:34:51+00:00</updated>
<author>
<name>Samuel BF</name>
<email>36460-samuelbf@users.noreply.framagit.org</email>
</author>
<published>2022-01-08T14:32:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=f868a56b935b6152d611b22f7a5538f14dafb194'/>
<id>f868a56b935b6152d611b22f7a5538f14dafb194</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>journal: allow JournalHandler constructor to be called with args in a positional param</title>
<updated>2020-11-12T18:05:37+00:00</updated>
<author>
<name>Tamaki Nishino</name>
<email>otamachan@gmail.com</email>
</author>
<published>2017-10-20T12:50:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=5dd8afda3ec83d245a4708638a40ca267d0dfed0'/>
<id>5dd8afda3ec83d245a4708638a40ca267d0dfed0</id>
<content type='text'>
This change enables to add extra fields to JournalHandler in a
configuration file loaded by `logging.config.fileConfig`, which only allows positional
parameters:

class=systemd.journal.JournalHandler
args={'level': INFO, 'SYSLOG_IDENTIFIER': 'my-cool-app'}

[zj: originally the patch added a new positional parameter to
__init__(), but that is not backwards compatible. So I added a new
classmethod to allow the positional parameters to be passed.]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change enables to add extra fields to JournalHandler in a
configuration file loaded by `logging.config.fileConfig`, which only allows positional
parameters:

class=systemd.journal.JournalHandler
args={'level': INFO, 'SYSLOG_IDENTIFIER': 'my-cool-app'}

[zj: originally the patch added a new positional parameter to
__init__(), but that is not backwards compatible. So I added a new
classmethod to allow the positional parameters to be passed.]
</pre>
</div>
</content>
</entry>
<entry>
<title>journal: do not convert extra args to string in JournalHandler</title>
<updated>2017-03-19T19:07:59+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2017-03-19T19:03:36+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=2169cdea8d2850a8e4109b2d1f3980d44a361818'/>
<id>2169cdea8d2850a8e4109b2d1f3980d44a361818</id>
<content type='text'>
send() already does conversions in a type-specific way, and doing it
in journal handler would defeat those conversions. In particular, UUIDs
would be converted to early and have dashes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
send() already does conversions in a type-specific way, and doing it
in journal handler would defeat those conversions. In particular, UUIDs
would be converted to early and have dashes.
</pre>
</div>
</content>
</entry>
<entry>
<title>test_journal: add tests for MESSAGE_ID passing</title>
<updated>2017-03-19T19:06:19+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2017-03-19T17:12:20+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=aa5550a9b7bb6fc0297c2f1bcb404daed1496251'/>
<id>aa5550a9b7bb6fc0297c2f1bcb404daed1496251</id>
<content type='text'>
MESSAGE_ID passing was broken before previous commit:
TypeError: send() got multiple values for keyword argument 'MESSAGE_ID'

With the previous commit it's broken differently:

______________________________ test_journalhandler_message_id_on_handler _______________________________

    def test_journalhandler_message_id_on_handler():
        record = logging.LogRecord('test-logger', logging.INFO, 'testpath', 1, 'test', None, None)
        sender = MockSender()
        handler = journal.JournalHandler(logging.INFO, sender_function=sender.send,
                                         MESSAGE_ID=TEST_MID)
        handler.emit(record)
        assert len(sender.buf) == 1
&gt;       assert 'MESSAGE_ID=' + TEST_MID.hex in sender.buf[0]
E       assert ('MESSAGE_ID=' + '8441372f8dca4ca98694a6091fd8519f') in ['MESSAGE=test', 'MESSAGE_ID=8441372f-8dca-4ca9-8694-a6091fd8519f', 'CODE_FILE=testpath', 'CODE_LINE=1', 'name=test-logger', 'exc_info=None', ...]
E        +  where '8441372f8dca4ca98694a6091fd8519f' = UUID('8441372f-8dca-4ca9-8694-a6091fd8519f').hex

systemd/test/test_journal.py:116: AssertionError
______________________________ test_journalhandler_message_id_on_message _______________________________

    def test_journalhandler_message_id_on_message():
        record = logging.LogRecord('test-logger', logging.INFO, 'testpath', 1, 'test', None, None)
        record.__dict__['MESSAGE_ID'] = TEST_MID2
        sender = MockSender()
        handler = journal.JournalHandler(logging.INFO, sender_function=sender.send,
                                         MESSAGE_ID=TEST_MID)
        handler.emit(record)
        assert len(sender.buf) == 1
&gt;       assert 'MESSAGE_ID=' + TEST_MID2.hex in sender.buf[0]
E       assert ('MESSAGE_ID=' + '8441370000000000000000001fd85000') in ['MESSAGE=test', 'MESSAGE_ID=84413700-0000-0000-0000-00001fd85000', 'CODE_FILE=testpath', 'CODE_LINE=1', 'name=test-logger', 'exc_info=None', ...]
E        +  where '8441370000000000000000001fd85000' = UUID('84413700-0000-0000-0000-00001fd85000').hex

systemd/test/test_journal.py:135: AssertionError
============================ 2 failed, 53 passed, 6 skipped in 0.16 seconds ============================
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MESSAGE_ID passing was broken before previous commit:
TypeError: send() got multiple values for keyword argument 'MESSAGE_ID'

With the previous commit it's broken differently:

______________________________ test_journalhandler_message_id_on_handler _______________________________

    def test_journalhandler_message_id_on_handler():
        record = logging.LogRecord('test-logger', logging.INFO, 'testpath', 1, 'test', None, None)
        sender = MockSender()
        handler = journal.JournalHandler(logging.INFO, sender_function=sender.send,
                                         MESSAGE_ID=TEST_MID)
        handler.emit(record)
        assert len(sender.buf) == 1
&gt;       assert 'MESSAGE_ID=' + TEST_MID.hex in sender.buf[0]
E       assert ('MESSAGE_ID=' + '8441372f8dca4ca98694a6091fd8519f') in ['MESSAGE=test', 'MESSAGE_ID=8441372f-8dca-4ca9-8694-a6091fd8519f', 'CODE_FILE=testpath', 'CODE_LINE=1', 'name=test-logger', 'exc_info=None', ...]
E        +  where '8441372f8dca4ca98694a6091fd8519f' = UUID('8441372f-8dca-4ca9-8694-a6091fd8519f').hex

systemd/test/test_journal.py:116: AssertionError
______________________________ test_journalhandler_message_id_on_message _______________________________

    def test_journalhandler_message_id_on_message():
        record = logging.LogRecord('test-logger', logging.INFO, 'testpath', 1, 'test', None, None)
        record.__dict__['MESSAGE_ID'] = TEST_MID2
        sender = MockSender()
        handler = journal.JournalHandler(logging.INFO, sender_function=sender.send,
                                         MESSAGE_ID=TEST_MID)
        handler.emit(record)
        assert len(sender.buf) == 1
&gt;       assert 'MESSAGE_ID=' + TEST_MID2.hex in sender.buf[0]
E       assert ('MESSAGE_ID=' + '8441370000000000000000001fd85000') in ['MESSAGE=test', 'MESSAGE_ID=84413700-0000-0000-0000-00001fd85000', 'CODE_FILE=testpath', 'CODE_LINE=1', 'name=test-logger', 'exc_info=None', ...]
E        +  where '8441370000000000000000001fd85000' = UUID('84413700-0000-0000-0000-00001fd85000').hex

systemd/test/test_journal.py:135: AssertionError
============================ 2 failed, 53 passed, 6 skipped in 0.16 seconds ============================
</pre>
</div>
</content>
</entry>
<entry>
<title>journal: rename SENDER_FUNCTION to sender_function</title>
<updated>2017-03-19T17:28:15+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2017-03-19T16:59:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=84371c2cfda49483f6dabc6bb85cb0131df1053e'/>
<id>84371c2cfda49483f6dabc6bb85cb0131df1053e</id>
<content type='text'>
Let's not try to make it look like a journal field. It should
be a normal parameter.

Followup for dce0a855c3281e7051b1cbe0f73386d1c90ef320.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let's not try to make it look like a journal field. It should
be a normal parameter.

Followup for dce0a855c3281e7051b1cbe0f73386d1c90ef320.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix styling to match PEP8 in most places (#45)</title>
<updated>2017-03-14T21:36:46+00:00</updated>
<author>
<name>Wesley Bowman</name>
<email>wesley.bowman23@gmail.com</email>
</author>
<published>2017-03-14T21:36:46+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=73807b49c495105b33b83deec1402080a78b09b0'/>
<id>73807b49c495105b33b83deec1402080a78b09b0</id>
<content type='text'>
Backwards compatibility for mapPriority is retained.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Backwards compatibility for mapPriority is retained.
</pre>
</div>
</content>
</entry>
<entry>
<title>Adjust import order, spacing, operators as recommended by pylint</title>
<updated>2017-03-12T16:27:49+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2016-12-17T12:39:05+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=14b05bfff57feed1f20e6b562bed188bc08252dc'/>
<id>14b05bfff57feed1f20e6b562bed188bc08252dc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #31 from keszybz/is_socket_sockaddr</title>
<updated>2017-03-11T19:26:27+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2017-03-11T19:26:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/python-systemd.git/commit/?id=753a4ca5ffbea9e7b937dbe5c567353f9ca21f85'/>
<id>753a4ca5ffbea9e7b937dbe5c567353f9ca21f85</id>
<content type='text'>
daemon: add basic support for sd_is_socket_sockaddr</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
daemon: add basic support for sd_is_socket_sockaddr</pre>
</div>
</content>
</entry>
</feed>
