Merge pull request #2806 from lbryio/privacyDefault
change default privacy setting
This commit is contained in:
commit
22c8ca6c40
3 changed files with 11 additions and 9 deletions
|
@ -601,7 +601,7 @@ class Config(CLIConfig):
|
||||||
save_files = Toggle("Save downloaded files when calling `get` by default", True)
|
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", [])
|
components_to_skip = Strings("components which will be skipped during start-up of daemon", [])
|
||||||
share_usage_data = Toggle(
|
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']
|
previous_names=['upload_log', 'upload_log', 'share_debug_info']
|
||||||
)
|
)
|
||||||
track_bandwidth = Toggle("Track bandwidth usage", True)
|
track_bandwidth = Toggle("Track bandwidth usage", True)
|
||||||
|
|
|
@ -122,6 +122,10 @@ async def get_mock_wallet(sd_hash, storage, balance=10.0, fee=None):
|
||||||
|
|
||||||
|
|
||||||
class TestStreamManager(BlobExchangeTestBase):
|
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):
|
async def setup_stream_manager(self, balance=10.0, fee=None, old_sort=False):
|
||||||
file_path = os.path.join(self.server_dir, "test_file")
|
file_path = os.path.join(self.server_dir, "test_file")
|
||||||
with open(file_path, 'wb') as f:
|
with open(file_path, 'wb') as f:
|
||||||
|
|
|
@ -80,27 +80,25 @@ class CLILoggingTest(AsyncioTestCase):
|
||||||
self.assertFalse(log.getChild("torba").isEnabledFor(logging.DEBUG))
|
self.assertFalse(log.getChild("torba").isEnabledFor(logging.DEBUG))
|
||||||
|
|
||||||
async def test_loggly(self):
|
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
|
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")
|
log = log.getChild("lbry")
|
||||||
self.assertEqual(len(log.handlers), 3)
|
self.assertEqual(len(log.handlers), 3)
|
||||||
self.assertIsInstance(log.handlers[2], HTTPSLogglyHandler)
|
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")
|
log = log.getChild("lbry")
|
||||||
self.assertEqual(len(log.handlers), 3)
|
self.assertEqual(len(log.handlers), 2)
|
||||||
self.assertIsInstance(log.handlers[2], HTTPSLogglyHandler)
|
|
||||||
|
|
||||||
async def test_quiet(self):
|
async def test_quiet(self):
|
||||||
async with get_logger(["start"]) as log: # default is loud
|
async with get_logger(["start"]) as log: # default is loud
|
||||||
log = log.getChild("lbry")
|
log = log.getChild("lbry")
|
||||||
self.assertEqual(len(log.handlers), 3)
|
self.assertEqual(len(log.handlers), 2)
|
||||||
self.assertIs(type(log.handlers[1]), logging.StreamHandler)
|
self.assertIs(type(log.handlers[1]), logging.StreamHandler)
|
||||||
async with get_logger(["start", "--quiet"]) as log:
|
async with get_logger(["start", "--quiet"]) as log:
|
||||||
log = log.getChild("lbry")
|
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[0]), logging.StreamHandler)
|
||||||
self.assertIsNot(type(log.handlers[1]), logging.StreamHandler)
|
|
||||||
|
|
||||||
|
|
||||||
class CLITest(AsyncioTestCase):
|
class CLITest(AsyncioTestCase):
|
||||||
|
|
Loading…
Reference in a new issue