Commit 6dc7d1d6 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Update tests to use context for checking error raise

parent 057a64a7
...@@ -363,10 +363,11 @@ class TestBusinessPackage(ERP5TypeTestCase): ...@@ -363,10 +363,11 @@ class TestBusinessPackage(ERP5TypeTestCase):
test_folder.edit(title='couscous') test_folder.edit(title='couscous')
portal_templates.installMultipleBusinessManager([managerA_new,]) with self.assertRaises(ValueError) as context:
portal_templates.installMultipleBusinessManager([managerA_new,])
installed_test_folder = self.portal.restrictedTraverse(folder_path) self.assertTrue('Trying to remove changes at ZODB at test_folder' in
# XXX: What to expect: couscous or new_couscous? or conflict display context.exception)
def test_useCase_VI(self): def test_useCase_VI(self):
""" """
...@@ -486,11 +487,11 @@ class TestBusinessPackage(ERP5TypeTestCase): ...@@ -486,11 +487,11 @@ class TestBusinessPackage(ERP5TypeTestCase):
# Delete the object from ZODB so as we can install the object there # Delete the object from ZODB so as we can install the object there
self.portal.manage_delObjects([installed_test_folder.getId(),]) self.portal.manage_delObjects([installed_test_folder.getId(),])
portal_templates.installMultipleBusinessManager([managerA_new,]) with self.assertRaises(ValueError) as context:
portal_templates.installMultipleBusinessManager([managerA_new,])
# Expected result undecided, if forced installation, then install the folder self.assertTrue('Object at test_folder removed by user' in
# from updated Business Manager, otherwise let the user change in ZODB context.exception)
# persist, i.e, no test_folder
def test_useCase_IX(self): def test_useCase_IX(self):
""" """
...@@ -667,10 +668,11 @@ class TestBusinessPackage(ERP5TypeTestCase): ...@@ -667,10 +668,11 @@ class TestBusinessPackage(ERP5TypeTestCase):
managerA_new.build() managerA_new.build()
managerA_new.setStatus('uninstalled') managerA_new.setStatus('uninstalled')
# Install the updated Business Manager with self.assertRaises(ValueError) as context:
portal_templates.installMultipleBusinessManager([managerA_new,]) portal_templates.installMultipleBusinessManager([managerA_new,])
# Expected should be conflict as change by the user and updated BM conflicts self.assertTrue('Trying to remove changes at ZODB at test_folder' in
context.exception)
def test_useCase_XIII(self): def test_useCase_XIII(self):
""" """
...@@ -756,13 +758,13 @@ class TestBusinessPackage(ERP5TypeTestCase): ...@@ -756,13 +758,13 @@ class TestBusinessPackage(ERP5TypeTestCase):
# Change the title at ZODB again # Change the title at ZODB again
installed_test_folder.edit(title='new_couscous_redefined') installed_test_folder.edit(title='new_couscous_redefined')
# Install the Business Manager with self.assertRaises(ValueError) as context:
portal_templates.installMultipleBusinessManager([managerA_new,]) portal_templates.installMultipleBusinessManager([managerA_new,])
# Expected result should show confict between the two as at both ZODB as self.assertTrue('Trying to remove changes at ZODB at test_folder' in
# well as updated BM, we do make changes in the test_folder context.exception)
def test_globalInstallationOfBusinessTemplate(self): def _globalInstallationOfBusinessTemplate(self):
""" """
NOTE: NOTE:
Keep in mind that the installation is done on copy of built Business Manager Keep in mind that the installation is done on copy of built Business Manager
......
...@@ -58,27 +58,26 @@ ...@@ -58,27 +58,26 @@
<string>W:320, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:320, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:343, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:343, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:360, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:360, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:368, 4: Unused variable \'installed_test_folder\' (unused-variable)</string> <string>W:390, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:389, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:403, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:402, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:429, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:428, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:439, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:438, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:469, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:468, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:483, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:482, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:514, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:513, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:533, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:532, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:561, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:560, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:574, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:573, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:605, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:604, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:619, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:618, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:650, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:649, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:667, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:666, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:696, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:694, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:709, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:707, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:740, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:738, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:754, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:752, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 1 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:800, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 2 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:798, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 2 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string> <string>W:839, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 2 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
<string>W:837, 4: Possible unbalanced tuple unpacking with sequence defined at line 142: left side has 2 label(s), right side has 0 value(s) (unbalanced-tuple-unpacking)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment