gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-taler-util] 34/51: 4453. Test for GNUNET_LOG and GNU


From: gnunet
Subject: [GNUnet-SVN] [taler-taler-util] 34/51: 4453. Test for GNUNET_LOG and GNUNET_FORCE_LOG both defined.
Date: Mon, 23 Sep 2019 22:02:25 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository taler-util.

commit 6b36fa32ac264f4d55191b9edb46bf4fb3a32593
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Feb 7 14:53:21 2019 +0100

    4453.  Test for GNUNET_LOG and GNUNET_FORCE_LOG both defined.
---
 python/log/test_ut.py | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/python/log/test_ut.py b/python/log/test_ut.py
index 6de55de..eb51458 100755
--- a/python/log/test_ut.py
+++ b/python/log/test_ut.py
@@ -137,6 +137,19 @@ class TestGnunetLog(TestCase):
         os.environ["GNUNET_LOG"] = ";;;;DEBUG"
         gl = GL("gnunet-pylog")
         gl.setup(gl.ERROR)
-        
+        gl.log("msg", gl.DEBUG)
+        mocked_setLevel.assert_called_with(level=logging.ERROR)
+
+    # This function tests the case where *both* GNUNET_LOG and
+    # GNUNET_FORCE_LOG are defined.  The expectation is that the
+    # forced variable wins.
+    @patch("logging.Logger.setLevel")
+    @patch("logging.basicConfig")
+    def test_forced_env_AND_nonforced_env(self, mocked_basicConfig, 
mocked_setLevel):
+        assert None == os.environ.get("GNUNET_LOG")
+        assert None == os.environ.get("GNUNET_FORCE_LOG")
+        os.environ["GNUNET_LOG"] = ";;;;DEBUG"
+        os.environ["GNUNET_FORCE_LOG"] = ";;;;ERROR"
+        gl = GL("gnunet-pylog")
         gl.log("msg", gl.DEBUG)
         mocked_setLevel.assert_called_with(level=logging.ERROR)

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]