diff mbox series

[yocto-autobuilder-helper,5/8] scripts/send-qa-email: add tests for is_release_version

Message ID 20230313145145.2574842-6-alexis.lothore@bootlin.com
State New
Headers show
Series fix regression reports generation on "master-next" branches | expand

Commit Message

Alexis Lothoré March 13, 2023, 2:51 p.m. UTC
From: Alexis Lothoré <alexis.lothore@bootlin.com>

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 scripts/test_send_qa_email.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/scripts/test_send_qa_email.py b/scripts/test_send_qa_email.py
index c1347fb..48bca98 100755
--- a/scripts/test_send_qa_email.py
+++ b/scripts/test_send_qa_email.py
@@ -29,6 +29,12 @@  class TestVersion(unittest.TestCase):
         {"input": {"version": "4.1.rc4"}, "expected": "yocto-4.0"}
     ]
 
+    test_data_is_release_version = [
+        {"input": "yocto-4.2", "expected":True},
+        {"input": "20230313-15", "expected":False},
+        {"input": None, "expected":False}
+    ]
+
     def test_versions(self):
         for data in self.test_data_get_version:
             test_name = data["input"]["version"]
@@ -36,6 +42,10 @@  class TestVersion(unittest.TestCase):
                 self.assertEqual(send_qa_email.get_previous_tag(os.environ.get(
                     "POKY_PATH"), data["input"]["version"]), data["expected"])
 
+    def test_is_release_version(self):
+        for data in self.test_data_is_release_version:
+            with self.subTest(f"{data['input']}"):
+                self.assertEqual(send_qa_email.is_release_version(data['input']), data['expected'])
 
 if __name__ == '__main__':
     if os.environ.get("POKY_PATH") is None: