From 7d872c7863b9ce25ca4fffa668bbd2311f3d0c06 Mon Sep 17 00:00:00 2001 From: jessop Date: Thu, 13 Feb 2020 18:56:11 -0500 Subject: [PATCH 1/2] change default privacy setting --- lbry/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/conf.py b/lbry/conf.py index fe705958f..da2f45f85 100644 --- a/lbry/conf.py +++ b/lbry/conf.py @@ -601,7 +601,7 @@ class Config(CLIConfig): save_files = Toggle("Save downloaded files when calling `get` by default", True) components_to_skip = Strings("components which will be skipped during start-up of daemon", []) share_usage_data = Toggle( - "Whether to share usage stats and diagnostic info with LBRY.", True, + "Whether to share usage stats and diagnostic info with LBRY.", False, previous_names=['upload_log', 'upload_log', 'share_debug_info'] ) track_bandwidth = Toggle("Track bandwidth usage", True) From 237a8965eb02718a95129ce9ed87637059500019 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 17 Feb 2020 17:47:07 -0300 Subject: [PATCH 2/2] fix tests --- tests/unit/stream/test_stream_manager.py | 4 ++++ tests/unit/test_cli.py | 14 ++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/unit/stream/test_stream_manager.py b/tests/unit/stream/test_stream_manager.py index 65d35e945..a3967a844 100644 --- a/tests/unit/stream/test_stream_manager.py +++ b/tests/unit/stream/test_stream_manager.py @@ -122,6 +122,10 @@ async def get_mock_wallet(sd_hash, storage, balance=10.0, fee=None): class TestStreamManager(BlobExchangeTestBase): + async def asyncSetUp(self): + await super().asyncSetUp() + self.client_config.share_usage_data = True + async def setup_stream_manager(self, balance=10.0, fee=None, old_sort=False): file_path = os.path.join(self.server_dir, "test_file") with open(file_path, 'wb') as f: diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py index c17ae6476..76616d298 100644 --- a/tests/unit/test_cli.py +++ b/tests/unit/test_cli.py @@ -80,27 +80,25 @@ class CLILoggingTest(AsyncioTestCase): self.assertFalse(log.getChild("torba").isEnabledFor(logging.DEBUG)) async def test_loggly(self): - async with get_logger(["start"], share_usage_data=False) as log: + async with get_logger(["start"]) as log: # default share_usage_data=False self.assertEqual(len(log.getChild("lbry").handlers), 2) # file and console - async with get_logger(["start"]) as log: # default share_usage_data=True + async with get_logger(["start"], share_usage_data=True) as log: log = log.getChild("lbry") self.assertEqual(len(log.handlers), 3) self.assertIsInstance(log.handlers[2], HTTPSLogglyHandler) - async with get_logger(["start"], share_usage_data=True) as log: # explicit share_usage_data=True + async with get_logger(["start"], share_usage_data=False) as log: # explicit share_usage_data=False log = log.getChild("lbry") - self.assertEqual(len(log.handlers), 3) - self.assertIsInstance(log.handlers[2], HTTPSLogglyHandler) + self.assertEqual(len(log.handlers), 2) async def test_quiet(self): async with get_logger(["start"]) as log: # default is loud log = log.getChild("lbry") - self.assertEqual(len(log.handlers), 3) + self.assertEqual(len(log.handlers), 2) self.assertIs(type(log.handlers[1]), logging.StreamHandler) async with get_logger(["start", "--quiet"]) as log: log = log.getChild("lbry") - self.assertEqual(len(log.handlers), 2) + self.assertEqual(len(log.handlers), 1) self.assertIsNot(type(log.handlers[0]), logging.StreamHandler) - self.assertIsNot(type(log.handlers[1]), logging.StreamHandler) class CLITest(AsyncioTestCase):