Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rpm-software-management/createrepo_c.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAleš Matěj <amatej@redhat.com>2019-12-03 11:32:18 +0300
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>2019-12-03 15:46:45 +0300
commitd4fb876b4475c7ede4b49219229638bf32e9574d (patch)
tree06c622abfa5abaab99a278c3a4e884c1d6cd1b54 /tests
parentaf9c8b4575749c3d03afe6c704060661622199bb (diff)
Extend unit tests with reboot_suggested for UpdateRecord
Diffstat (limited to 'tests')
-rw-r--r--tests/python/tests/test_updateinfo.py6
-rw-r--r--tests/python/tests/test_updaterecord.py5
-rw-r--r--tests/test_xml_parser_updateinfo.c8
-rw-r--r--tests/testdata/updateinfo_files/updateinfo_01.xml1
-rw-r--r--tests/testdata/updateinfo_files/updateinfo_03.xml2
5 files changed, 22 insertions, 0 deletions
diff --git a/tests/python/tests/test_updateinfo.py b/tests/python/tests/test_updateinfo.py
index 727b707..7feaae9 100644
--- a/tests/python/tests/test_updateinfo.py
+++ b/tests/python/tests/test_updateinfo.py
@@ -36,6 +36,7 @@ class TestCaseUpdateInfo(unittest.TestCase):
rec.summary = "summary"
rec.description = "description"
rec.solution = "solution"
+ rec.reboot_suggested = True
ui.append(rec)
@@ -57,6 +58,7 @@ class TestCaseUpdateInfo(unittest.TestCase):
self.assertEqual(rec.summary, "summary")
self.assertEqual(rec.description, "description")
self.assertEqual(rec.solution, "solution")
+ self.assertEqual(rec.reboot_suggested, True)
self.assertEqual(len(rec.references), 0)
self.assertEqual(len(rec.collections), 0)
@@ -92,6 +94,7 @@ class TestCaseUpdateInfo(unittest.TestCase):
rec.summary = "summary"
rec.description = "description"
rec.solution = "solution"
+ rec.reboot_suggested = True
ui.append(rec)
xml = ui.xml_dump()
@@ -111,6 +114,7 @@ class TestCaseUpdateInfo(unittest.TestCase):
<summary>summary</summary>
<description>description</description>
<solution>solution</solution>
+ <reboot_suggested/>
<references/>
<pkglist/>
</update>
@@ -349,6 +353,7 @@ class TestCaseUpdateInfo(unittest.TestCase):
rec.summary = "summary"
rec.description = "description"
rec.solution = "solution"
+ rec.reboot_suggested = True
rec.append_collection(col)
rec.append_reference(ref)
@@ -372,6 +377,7 @@ class TestCaseUpdateInfo(unittest.TestCase):
<summary>summary</summary>
<description>description</description>
<solution>solution</solution>
+ <reboot_suggested/>
<references>
<reference href="href" id="id" type="type" title="title"/>
</references>
diff --git a/tests/python/tests/test_updaterecord.py b/tests/python/tests/test_updaterecord.py
index 6777f04..7a1a191 100644
--- a/tests/python/tests/test_updaterecord.py
+++ b/tests/python/tests/test_updaterecord.py
@@ -32,6 +32,7 @@ class TestCaseUpdateRecord(unittest.TestCase):
self.assertEqual(rec.severity, None)
self.assertEqual(rec.summary, None)
self.assertEqual(rec.description, None)
+ self.assertEqual(rec.reboot_suggested, 0)
self.assertEqual(rec.solution, None)
self.assertEqual(rec.references, [])
self.assertEqual(rec.collections, [])
@@ -60,6 +61,7 @@ class TestCaseUpdateRecord(unittest.TestCase):
rec.severity = "severity"
rec.summary = "summary"
rec.description = "description"
+ rec.reboot_suggested = True
rec.solution = "solution"
rec.append_reference(ref)
rec.append_collection(col)
@@ -77,6 +79,7 @@ class TestCaseUpdateRecord(unittest.TestCase):
self.assertEqual(rec.pushcount, "pushcount")
self.assertEqual(rec.severity, "severity")
self.assertEqual(rec.summary, "summary")
+ self.assertEqual(rec.reboot_suggested, True)
self.assertEqual(rec.description, "description")
self.assertEqual(rec.solution, "solution")
self.assertEqual(len(rec.references), 1)
@@ -115,6 +118,7 @@ class TestCaseUpdateRecord(unittest.TestCase):
rec.summary = "summary"
rec.description = "description"
rec.solution = "solution"
+ rec.reboot_suggested = True
xml = cr.xml_dump_updaterecord(rec)
self.assertEqual(xml,
@@ -130,6 +134,7 @@ class TestCaseUpdateRecord(unittest.TestCase):
<summary>summary</summary>
<description>description</description>
<solution>solution</solution>
+ <reboot_suggested/>
<references/>
<pkglist/>
</update>
diff --git a/tests/test_xml_parser_updateinfo.c b/tests/test_xml_parser_updateinfo.c
index 976922e..07ef50e 100644
--- a/tests/test_xml_parser_updateinfo.c
+++ b/tests/test_xml_parser_updateinfo.c
@@ -76,6 +76,7 @@ test_cr_xml_parse_updateinfo_01(void)
g_assert_cmpstr(update->summary, ==, "summary_1");
g_assert_cmpstr(update->description, ==, "description_1");
g_assert_cmpstr(update->solution, ==, "solution_1");
+ g_assert(update->reboot_suggested);
g_assert_cmpint(g_slist_length(update->references), ==, 1);
ref = update->references->data;
@@ -137,6 +138,7 @@ test_cr_xml_parse_updateinfo_02(void)
g_assert(!update->pushcount);
g_assert(!update->severity);
g_assert(!update->summary);
+ g_assert(!update->reboot_suggested);
g_assert(!update->description);
g_assert(!update->solution);
@@ -186,6 +188,10 @@ test_cr_xml_parse_updateinfo_03(void)
g_assert_cmpint(ret, ==, CRE_OK);
g_assert_cmpint(g_slist_length(ui->updates), ==, 6);
+
+ update = g_slist_nth_data(ui->updates, 2);
+ g_assert(!update->reboot_suggested);
+
update = g_slist_nth_data(ui->updates, 3);
g_assert_cmpstr(update->from, ==, "errata@redhat.com");
@@ -195,6 +201,7 @@ test_cr_xml_parse_updateinfo_03(void)
g_assert_cmpstr(update->id, ==, "RHEA-2012:0058");
g_assert_cmpstr(update->title, ==, "Gorilla_Erratum");
g_assert_cmpstr(update->description, ==, "Gorilla_Erratum");
+ g_assert(update->reboot_suggested);
update = g_slist_nth_data(ui->updates, 4);
@@ -204,6 +211,7 @@ test_cr_xml_parse_updateinfo_03(void)
g_assert_cmpstr(update->issued_date, ==, "2018-01-27 16:08:09");
g_assert_cmpstr(update->updated_date, ==, "2018-07-20 06:00:01 UTC");
g_assert_cmpstr(update->release, ==, "1");
+ g_assert(update->reboot_suggested);
g_assert_cmpint(g_slist_length(update->references), ==, 0);
diff --git a/tests/testdata/updateinfo_files/updateinfo_01.xml b/tests/testdata/updateinfo_files/updateinfo_01.xml
index b757ef8..415140e 100644
--- a/tests/testdata/updateinfo_files/updateinfo_01.xml
+++ b/tests/testdata/updateinfo_files/updateinfo_01.xml
@@ -12,6 +12,7 @@
<summary>summary_1</summary>
<description>description_1</description>
<solution>solution_1</solution>
+ <reboot_suggested>True</reboot_suggested>
<references>
<reference href="https://foobar/foobarupdate_1" id="1" type="self" title="update_1"/>
</references>
diff --git a/tests/testdata/updateinfo_files/updateinfo_03.xml b/tests/testdata/updateinfo_files/updateinfo_03.xml
index ddbd99b..39dfbef 100644
--- a/tests/testdata/updateinfo_files/updateinfo_03.xml
+++ b/tests/testdata/updateinfo_files/updateinfo_03.xml
@@ -70,6 +70,7 @@
<issued date="2013-01-27 16:08:09"/>
<updated date="2014-07-20 06:00:01 UTC"/>
<description>Gorilla_Erratum</description>
+ <reboot_suggested>True</reboot_suggested>
<pkglist>
<collection short="">
<name>1</name>
@@ -87,6 +88,7 @@
<issued date="2018-01-27 16:08:09"/>
<updated date="2018-07-20 06:00:01 UTC"/>
<description>Duck_Kangaro_Erratum description</description>
+ <reboot_suggested/>
<pkglist>
<collection short="">
<name>coll_name1</name>