Move some of the logic in get_prefixed_version to a ModuleBuild static method

The logic used to parse the stream version will need to be reused elsewhere
to support the filtering and ordering of a base module stream version.
This commit is contained in:
mprahl
2018-10-11 14:48:02 -04:00
parent 8ef445c0b2
commit 4f9fffff3b
3 changed files with 43 additions and 24 deletions

View File

@@ -93,6 +93,11 @@ class TestModels:
build_one = ModuleBuild.query.get(2)
assert build_one.siblings == [3, 4]
def test_get_stream_version(self):
"""Test the ModuleBuild.get_stream_version method when right_pad is True."""
assert ModuleBuild.get_stream_version('f27') == 270000
assert ModuleBuild.get_stream_version('f27.02.30') == 270230
class TestModelsGetStreamsContexts: