예제 #1
0
 def test_repair3(self):
     """test repair (invalid _packages xml)"""
     path = self.fixture_file('inv4')
     self.assertRaises(WCInconsistentError, Project, path)
     self.assertRaises(ValueError, Project.repair, path)
     Project.repair(path, added='A', missing=' ')
     self.assertEqual(Project.wc_check(path), ([], '', []))
예제 #2
0
 def test_repair3(self):
     """test repair (invalid _packages xml)"""
     path = self.fixture_file('inv4')
     self.assertRaises(WCInconsistentError, Project, path)
     self.assertRaises(ValueError, Project.repair, path)
     Project.repair(path, added='A', missing=' ')
     self.assertEqual(Project.wc_check(path), ([], '', []))
예제 #3
0
 def test_repair4(self):
     """test repair (wc + pkg data missing)"""
     # remove package from _packages in this case
     path = self.fixture_file('inv5')
     self.assertRaises(WCInconsistentError, Project, path)
     Project.repair(path)
     self.assertEqual(Project.wc_check(path), ([], '', []))
     prj = Project(path)
     self.assertEqual(prj._status('missing'), '?')
     self.assertEqual(prj._status('added'), 'A')
예제 #4
0
 def test_repair4(self):
     """test repair (wc + pkg data missing)"""
     # remove package from _packages in this case
     path = self.fixture_file('inv5')
     self.assertRaises(WCInconsistentError, Project, path)
     Project.repair(path)
     self.assertEqual(Project.wc_check(path), ([], '', []))
     prj = Project(path)
     self.assertEqual(prj._status('missing'), '?')
     self.assertEqual(prj._status('added'), 'A')
예제 #5
0
 def test_repair2(self):
     """test repair (missing pkg data; state ' ')"""
     path = self.fixture_file('inv3')
     self._not_exists(path, 'conflict', data=True)
     self.assertRaises(WCInconsistentError, Project, path)
     Project.repair(path)
     self.assertEqual(Project.wc_check(path), ([], '', []))
     self._exists(path, 'conflict', data=True)
     prj = Project(path)
     self.assertEqual(prj._status('conflict'), ' ')
     self.assertIsNotNone(prj.package('conflict'))
예제 #6
0
 def test_repair1(self):
     """test repair (missing _project and storefile)"""
     path = self.fixture_file('inv1')
     self._not_exists(path, '_project', store=True)
     self.assertRaises(WCInconsistentError, Project, path)
     self.assertRaises(ValueError, Project.repair, path)
     Project.repair(path, project='inv1')
     self.assertEqual(Project.wc_check(path), ([], '', []))
     self._exists(path, '_project', store=True)
     prj = Project(path)
     self.assertEqual(prj.name, 'inv1')
예제 #7
0
 def test_repair2(self):
     """test repair (missing pkg data; state ' ')"""
     path = self.fixture_file('inv3')
     self._not_exists(path, 'conflict', data=True)
     self.assertRaises(WCInconsistentError, Project, path)
     Project.repair(path)
     self.assertEqual(Project.wc_check(path), ([], '', []))
     self._exists(path, 'conflict', data=True)
     prj = Project(path)
     self.assertEqual(prj._status('conflict'), ' ')
     self.assertIsNotNone(prj.package('conflict'))
예제 #8
0
 def test_repair1(self):
     """test repair (missing _project and storefile)"""
     path = self.fixture_file('inv1')
     self._not_exists(path, '_project', store=True)
     self.assertRaises(WCInconsistentError, Project, path)
     self.assertRaises(ValueError, Project.repair, path)
     Project.repair(path, project='inv1')
     self.assertEqual(Project.wc_check(path), ([], '', []))
     self._exists(path, '_project', store=True)
     prj = Project(path)
     self.assertEqual(prj.name, 'inv1')