1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-21 05:58:52 +02:00

Merge branch 'tests_python3_fixes' of https://github.com/marcus-h/osc

Make the testsuite work with python3.8
This commit is contained in:
Marcus Huewe
2020-06-04 12:00:14 +02:00
2 changed files with 74 additions and 31 deletions

View File

@@ -46,7 +46,7 @@ class TestRequest(OscTestCase):
<target package="bar" project="foobar" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_createsr_with_option(self):
"""create a submitrequest with option"""
@@ -75,7 +75,7 @@ class TestRequest(OscTestCase):
</options>
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_createsr_missing_tgt_package(self):
"""create a submitrequest with missing target package"""
@@ -96,7 +96,7 @@ class TestRequest(OscTestCase):
<target project="foobar" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_createsr_invalid_argument(self):
"""create a submitrequest with invalid action argument"""
@@ -125,7 +125,7 @@ class TestRequest(OscTestCase):
<person name="user" role="reader" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_add_role_group(self):
"""create an add_role request (group element)"""
@@ -146,7 +146,7 @@ class TestRequest(OscTestCase):
<group name="group" role="reviewer" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_add_role_person_group(self):
"""create an add_role request (person+group element)"""
@@ -169,7 +169,7 @@ class TestRequest(OscTestCase):
<group name="group" role="reviewer" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_set_bugowner_project(self):
"""create a set_bugowner request for a project"""
@@ -187,7 +187,7 @@ class TestRequest(OscTestCase):
<person name="buguser" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_set_bugowner_package(self):
"""create a set_bugowner request for a package"""
@@ -205,7 +205,7 @@ class TestRequest(OscTestCase):
<person name="buguser" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_delete_project(self):
"""create a delete request for a project"""
@@ -221,7 +221,7 @@ class TestRequest(OscTestCase):
<target project="foo" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_delete_package(self):
"""create a delete request for a package"""
@@ -237,7 +237,7 @@ class TestRequest(OscTestCase):
<target package="deleteme" project="foo" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_create_change_devel(self):
"""create a change devel request"""
@@ -256,7 +256,7 @@ class TestRequest(OscTestCase):
<target package="devpkg" project="devprj" />
</action>
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_action_from_xml1(self):
"""create action from xml"""
@@ -273,7 +273,7 @@ class TestRequest(OscTestCase):
self.assertEqual(action.person_role, 'reader')
self.assertEqual(action.group_name, 'group')
self.assertEqual(action.group_role, 'reviewer')
self.assertEqual(xml, action.to_str())
self.assertXMLEqual(xml, action.to_str())
def test_action_from_xml2(self):
"""create action from xml"""
@@ -294,7 +294,7 @@ class TestRequest(OscTestCase):
self.assertEqual(action.opt_sourceupdate, 'cleanup')
self.assertEqual(action.opt_updatelink, '1')
self.assertTrue(action.src_rev is None)
self.assertEqual(xml, action.to_str())
self.assertXMLEqual(xml, action.to_str())
def test_action_from_xml3(self):
"""create action from xml (with acceptinfo element)"""
@@ -317,7 +317,7 @@ class TestRequest(OscTestCase):
self.assertEqual(action.acceptinfo_xsrcmd5, 'ffffffffffffffffffffffffffffffff')
self.assertTrue(action.acceptinfo_osrcmd5 is None)
self.assertTrue(action.acceptinfo_oxsrcmd5 is None)
self.assertEqual(xml, action.to_str())
self.assertXMLEqual(xml, action.to_str())
def test_action_from_xml_unknown_type(self):
"""try to create action from xml with unknown type"""
@@ -353,7 +353,7 @@ class TestRequest(OscTestCase):
self.assertEqual(r.description, 'this is a\nvery long\ndescription')
self.assertTrue(len(r.statehistory) == 1)
self.assertTrue(len(r.reviews) == 0)
self.assertEqual(xml, r.to_str())
self.assertXMLEqual(xml, r.to_str())
def test_read_request2(self):
"""read in a request (with reviews)"""
@@ -391,7 +391,7 @@ class TestRequest(OscTestCase):
self.assertEqual(r.creator, 'creator')
self.assertTrue(len(r.statehistory) == 1)
self.assertTrue(len(r.reviews) == 1)
self.assertEqual(xml, r.to_str())
self.assertXMLEqual(xml, r.to_str())
def test_read_request3(self):
"""read in a request (with an "empty" comment+description)"""
@@ -427,7 +427,7 @@ class TestRequest(OscTestCase):
<state name="new" when="2010-12-28T12:36:29" who="xyz" />
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_request_list_view1(self):
"""test the list_view method"""
@@ -555,7 +555,7 @@ Comment: <no comment>"""
</action>
<state name="new" when="2010-12-30T02:11:22" who="olduser" />
</request>"""
self.assertEqual(exp, r.to_str())
self.assertXMLEqual(exp, r.to_str())
def test_get_actions(self):
"""test get_actions method"""