Allow untested Desktop versions with compatibility warnings
This commit is contained in:
1 parent
d2b621bce7
commit
ab69f287b6
16 files changed
+1571
-1495
No files matched your search
@@ -289,3 +289,25 @@ class NativeCacheTests(unittest.TestCase):
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
||||
class DesktopCompatibilityTests(unittest.TestCase):
|
||||
def test_untested_version_and_core_are_advisory(self):
|
||||
from whatsapp_suite import desktop
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
path=Path(folder)/'WhatsAppDesktop_9.9.9.0_x64'/'Core.dll'
|
||||
path.parent.mkdir();path.write_bytes(b'other core fixture')
|
||||
result=desktop.check_core_build(path)
|
||||
self.assertEqual(result['detected_build'],'9.9.9.0')
|
||||
self.assertFalse(result['matches_tested_configuration'])
|
||||
self.assertIn('Untested',result['warning'])
|
||||
|
||||
def test_tested_configuration_has_no_warning(self):
|
||||
from whatsapp_suite import desktop
|
||||
payload=b'tested core fixture'
|
||||
with tempfile.TemporaryDirectory() as folder, patch.object(desktop,'CORE_SHA256',hashlib.sha256(payload).hexdigest()):
|
||||
path=Path(folder)/('WhatsAppDesktop_'+desktop.TESTED_BUILD+'_x64')/'Core.dll'
|
||||
path.parent.mkdir();path.write_bytes(payload)
|
||||
result=desktop.check_core_build(path)
|
||||
self.assertTrue(result['matches_tested_configuration'])
|
||||
self.assertIsNone(result['warning'])
|
||||
Reference in new issue
Block a user