mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-03 22:23:38 +02:00
- new testcase: repairwc: repair a project wc with no apiurl
This commit is contained in:
1
tests/repairwc_fixtures/prj_noapiurl/.osc/_packages
Normal file
1
tests/repairwc_fixtures/prj_noapiurl/.osc/_packages
Normal file
@@ -0,0 +1 @@
|
||||
<project name="prj_noapiurl" />
|
1
tests/repairwc_fixtures/prj_noapiurl/.osc/_project
Normal file
1
tests/repairwc_fixtures/prj_noapiurl/.osc/_project
Normal file
@@ -0,0 +1 @@
|
||||
prj_noapiurl
|
@@ -199,6 +199,19 @@ class TestRepairWC(OscTestCase):
|
||||
self.assertRaises(osc.oscerr.WorkingCopyInconsistent, p.wc_repair)
|
||||
self.assertFalse(os.path.exists(os.path.join('.osc', '_apiurl')))
|
||||
|
||||
def test_project_noapiurl(self):
|
||||
"""the project wc has no _apiurl file"""
|
||||
import shutil
|
||||
prj_dir = os.path.join(self.tmpdir, 'prj_noapiurl')
|
||||
shutil.copytree(os.path.join(self._get_fixtures_dir(), 'prj_noapiurl'), prj_dir)
|
||||
storedir = os.path.join(prj_dir, osc.core.store)
|
||||
self.assertRaises(osc.oscerr.WorkingCopyInconsistent, osc.core.Project, prj_dir, getPackageList=False)
|
||||
prj = osc.core.Project(prj_dir, wc_check=False, getPackageList=False)
|
||||
prj.wc_repair('http://localhost')
|
||||
self.assertTrue(os.path.exists(os.path.join(storedir, '_apiurl')))
|
||||
self.assertTrue(os.path.exists(os.path.join(storedir, '_apiurl')))
|
||||
self.assertEqual(open(os.path.join(storedir, '_apiurl'), 'r').read(), 'http://localhost\n')
|
||||
|
||||
if __name__ == '__main__':
|
||||
import unittest
|
||||
unittest.main()
|
||||
|
Reference in New Issue
Block a user