def test_encryption(self):
    adapters = speedify.show_adapters()
    self.assertTrue(adapters)
    adapterID = [adapter['adapterID'] for adapter in adapters][0]
    speedify.adapter_encryption(adapterID, False)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertTrue(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    perConnectionEncryptionSettings = mysettings['perConnectionEncryptionSettings']
    firstadapter = perConnectionEncryptionSettings[0]
    self.assertEqual(firstadapter['adapterID'], adapterID)
    self.assertEqual(firstadapter['encrypted'], False)
    self.assertTrue(encrypted)
    speedify.encryption(False)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertFalse(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    self.assertFalse(encrypted)
    speedify.adapter_encryption(adapterID, True)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertTrue(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    perConnectionEncryptionSettings = mysettings['perConnectionEncryptionSettings']
    firstadapter = perConnectionEncryptionSettings[0]
    self.assertEqual(firstadapter['adapterID'], adapterID)
    self.assertEqual(firstadapter['encrypted'], True)
    speedify.encryption(True)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertFalse(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    self.assertTrue(encrypted)
def test_encryption(self):
    adapters = speedify.show_adapters()
    self.assertTrue(adapters)
    adapterID = [adapter['adapterID'] for adapter in adapters][0]
    speedify.adapter_encryption(adapterID, False)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertTrue(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    perConnectionEncryptionSettings = mysettings['perConnectionEncryptionSettings']
    firstadapter = perConnectionEncryptionSettings[0]
    self.assertEqual(firstadapter['adapterID'], adapterID)
    self.assertEqual(firstadapter['encrypted'], False)
    self.assertTrue(encrypted)
    speedify.encryption(False)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertFalse(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    self.assertFalse(encrypted)
    speedify.adapter_encryption(adapterID, True)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertTrue(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    perConnectionEncryptionSettings = mysettings['perConnectionEncryptionSettings']
    firstadapter = perConnectionEncryptionSettings[0]
    self.assertEqual(firstadapter['adapterID'], adapterID)
    self.assertEqual(firstadapter['encrypted'], True)
    speedify.encryption(True)
    mysettings = speedify.show_settings()
    perConnectionEncryptionEnabled = mysettings['perConnectionEncryptionEnabled']
    self.assertFalse(perConnectionEncryptionEnabled)
    encrypted = mysettings['encrypted']
    self.assertTrue(encrypted)