|
| 1 | +# Copyright 2024 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +"""SUSE ecosystem helper tests.""" |
| 15 | + |
| 16 | +import unittest |
| 17 | +from .. import ecosystems |
| 18 | + |
| 19 | + |
| 20 | +class SUSEEcosystemTest(unittest.TestCase): |
| 21 | + """SUSE ecosystem helper tests.""" |
| 22 | + |
| 23 | + def test_suse(self): |
| 24 | + """Test sort key""" |
| 25 | + ecosystem = ecosystems.get('SUSE') |
| 26 | + self.assertGreater( |
| 27 | + ecosystem.sort_key("2.38.5-150400.4.34.2"), |
| 28 | + ecosystem.sort_key("2.37.5-150400.4.34.2")) |
| 29 | + self.assertGreater( |
| 30 | + ecosystem.sort_key("2.0.8-4.8.2"), ecosystem.sort_key("0")) |
| 31 | + self.assertGreater( |
| 32 | + ecosystem.sort_key("2.0.8_k4.12.14_10.118-4.8.2"), |
| 33 | + ecosystem.sort_key("2.0.8-4.8.2")) |
| 34 | + self.assertLess( |
| 35 | + ecosystem.sort_key("1.86-150100.7.23.11"), |
| 36 | + ecosystem.sort_key("2.86-150100.7.23.1")) |
| 37 | + self.assertEqual( |
| 38 | + ecosystem.sort_key("2.0.8-4.8.2"), ecosystem.sort_key("2.0.8-4.8.2")) |
0 commit comments