-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix min_qg_version query * added 0 patch value for qgis version against max_qg_version * only add patch if it has major.minor version Co-authored-by: sumandari <[email protected]>
- Loading branch information
1 parent
a205eff
commit b1f16eb
Showing
2 changed files
with
75 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from django.test import TestCase | ||
|
||
from plugins.views import _add_patch_version | ||
|
||
|
||
class TestTruncateVersion(TestCase): | ||
"""Test _add_patch_version function""" | ||
|
||
def test__add_patch_version_with_3_segment_version_number(self): | ||
version = '1.2.3' | ||
self.assertEqual(_add_patch_version(version, '99'), '1.2.3') | ||
|
||
def test__add_patch_version_with_2_segment_version_number(self): | ||
version = '1.2' | ||
self.assertEqual(_add_patch_version(version, '00'), '1.2.00') | ||
|
||
def test__add_patch_version_with_1_segment_version_number(self): | ||
version = '1' | ||
self.assertEqual(_add_patch_version(version, '99'), '1') | ||
|
||
def test__add_patch_version_with_None(self): | ||
version = None | ||
self.assertEqual(_add_patch_version(version, '99'), None) | ||
|
||
def test__add_patch_version_with_empty_string(self): | ||
version = '' | ||
self.assertEqual(_add_patch_version(version, '99'), '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters