Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_compare_version_06(self):
a, b, r = (1, 1, 0, 'dev', 1), (1, 1, 0, 'dev', 1), 0
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_11(self):
a, b, r = (1, 0, 0, 'dev', 1), (0, 1, 1, 'dev', 2), -1
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_33(self):
a, b, r = (0, 0, 2, 'dev', 1), (0, 1, 0, 'final', 0), 1
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_12(self):
a, b, r = (0, 0, 1, 'dev', 1), (0, 0, 1, 'dev', 2), 1
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_22(self):
a, b, r = (1, 0, 1, 'final', 0), (1, 0, 1, 'final', 0), 0
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_23(self):
a, b, r = (1, 1, 0, 'final', 0), (1, 1, 0, 'final', 0), 0
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_02(self):
a, b, r = (0, 1, 0, 'dev', 1), (0, 1, 0, 'dev', 1), 0
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_13(self):
a, b, r = (0, 0, 1, 'dev', 2), (0, 0, 2, 'dev', 1), 1
self.assertEqual(compare_version_tuples(a, b), r)
def test_compare_version_03(self):
a, b, r = (0, 1, 1, 'dev', 1), (0, 1, 1, 'dev', 1), 0
self.assertEqual(compare_version_tuples(a, b), r)
def _display_results(self):
# Display results to user.
key = ''
high_version = PICARD_VERSION
for test_key in PROGRAM_UPDATE_LEVELS:
update_level = PROGRAM_UPDATE_LEVELS[test_key]['name']
test_version = self._available_versions.get(update_level, {}).get('version', (0, 0, 0, ''))
if self._update_level >= test_key and compare_version_tuples(high_version, test_version) > 0:
key = PROGRAM_UPDATE_LEVELS[test_key]['name']
high_version = test_version
if key:
if QMessageBox.information(
self._parent,
_("Picard Update"),
_("A new version of Picard is available.\n\n"
"This version: {picard_old_version}\n"
"New version: {picard_new_version}\n\n"
"Would you like to download the new version?").format(
picard_old_version=PICARD_FANCY_VERSION_STR,
picard_new_version=self._available_versions[key]['tag']
),
QMessageBox.Ok | QMessageBox.Cancel,
QMessageBox.Cancel
) == QMessageBox.Ok: