当前位置: 首页>>代码示例>>Python>>正文


Python Project.package方法代码示例

本文整理汇总了Python中osc2.wc.project.Project.package方法的典型用法代码示例。如果您正苦于以下问题:Python Project.package方法的具体用法?Python Project.package怎么用?Python Project.package使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osc2.wc.project.Project的用法示例。


在下文中一共展示了Project.package方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_commit7

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit7(self):
     """test commit (local state: 'A')"""
     path = self.fixture_file('prj1')
     tl = TL(abort=False)
     tl_abort = TL(abort=True)
     prj = Project(path, transaction_listener=[tl, tl_abort])
     pkg = prj.package('added')
     self.assertEqual(pkg.status('foo'), 'A')
     self.assertEqual(prj._status('added'), 'A')
     prj.commit('added')
     # this time no abort
     tl = TL(abort=False)
     prj = Project(path, transaction_listener=[tl])
     pkg = prj.package('added')
     self.assertEqual(pkg.status('foo'), 'A')
     self.assertEqual(prj._status('added'), 'A')
     prj.commit('added')
     self.assertEqual(prj._status('added'), ' ')
     pkg = prj.package('added')
     self.assertEqual(pkg.status('foo'), ' ')
     self._exists(path, '.osc', 'data', 'added')
     # check transaction listener
     self.assertEqual(tl._begin, ['prj_commit', 'commit'])
     self.assertEqual(tl._finished, ['commit', 'prj_commit'])
     self.assertEqual(tl._transfer, [('upload', 'foo')])
     self.assertEqual(set(tl._processed.keys()),
                      set(['foo', 'added']))
     self.assertEqual(tl._processed['foo'], (' ', 'A'))
     self.assertEqual(tl._processed['added'], (' ', 'A'))
开发者ID:scarabeusiv,项目名称:osc2,代码行数:31,代码来源:test_project.py

示例2: test_commit6

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit6(self):
     """test commit (package with a conflicted file)"""
     path = self.fixture_file('prj3')
     prj = Project(path)
     pkg = prj.package('conflict')
     self.assertEqual(pkg.status('conflict'), 'C')
     self.assertEqual(prj._status('conflict'), ' ')
     self.assertRaises(FileConflictError, prj.commit, 'conflict')
     self.assertEqual(prj._status('conflict'), ' ')
     pkg = prj.package('conflict')
     self.assertEqual(pkg.status('conflict'), 'C')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:13,代码来源:test_project.py

示例3: test_commit4

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit4(self):
     """test commit (same as test_commit4 but remote package exists)"""
     path = self.fixture_file('prj2')
     prj = Project(path)
     pkg = prj.package('bar')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(prj._status('bar'), 'A')
     prj.commit('bar')
     self.assertEqual(prj._status('bar'), ' ')
     pkg = prj.package('bar')
     self.assertEqual(pkg.status('add'), ' ')
     self._exists(path, '.osc', 'data', 'bar')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:14,代码来源:test_project.py

示例4: test_update8

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_update8(self):
     """test update (package with a conflicted file)"""
     path = self.fixture_file('prj3')
     prj = Project(path)
     pkg = prj.package('conflict')
     self.assertEqual(pkg.status('conflict'), 'C')
     self.assertEqual(prj._status('conflict'), ' ')
     # Note: package conflict would be deleted (if update were possible)
     self.assertRaises(FileConflictError, prj.update, 'conflict')
     self.assertEqual(prj._status('conflict'), ' ')
     pkg = prj.package('conflict')
     self.assertEqual(pkg.status('conflict'), 'C')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:14,代码来源:test_project.py

示例5: test_revert1

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_revert1(self):
     """revert modified package"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('modified'), ' ')
     pkg = prj.package('modified')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(pkg.status('file'), 'M')
     prj.revert('modified')
     self.assertEqual(prj._status('modified'), ' ')
     pkg = prj.package('modified')
     self.assertEqual(pkg.status('add'), '?')
     self.assertEqual(pkg.status('file'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:15,代码来源:test_project.py

示例6: test_commit9

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit9(self):
     """test commit (specify file + comment; local state ' ')"""
     path = self.fixture_file('prj2')
     prj = Project(path)
     pkg = prj.package('foo_modified')
     self.assertEqual(pkg.status('file'), 'M')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(prj._status('foo'), ' ')
     todo = {'foo_modified': ['file']}
     prj.commit(package_filenames=todo, comment='foo bar')
     self.assertEqual(prj._status('foo'), ' ')
     pkg = prj.package('foo_modified')
     self.assertEqual(pkg.status('file'), ' ')
     self.assertEqual(pkg.status('add'), 'A')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:16,代码来源:test_project.py

示例7: test_commit2

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit2(self):
     """test commit (local state: 'A')"""
     path = self.fixture_file('prj2')
     prj = Project(path)
     pkg = prj.package('bar')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(pkg.status('add2'), 'A')
     self.assertEqual(prj._status('bar'), 'A')
     prj.commit('bar')
     self.assertEqual(prj._status('bar'), ' ')
     pkg = prj.package('bar')
     self.assertEqual(pkg.status('add'), ' ')
     self.assertEqual(pkg.status('add2'), ' ')
     self._exists(path, '.osc', 'data', 'bar')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:16,代码来源:test_project.py

示例8: test_commit1

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit1(self):
     """test commit (local state: ' ')"""
     path = self.fixture_file('prj2')
     prj = Project(path)
     pkg = prj.package('foo_modified')
     self.assertEqual(pkg.status('file'), 'M')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(prj._status('foo'), ' ')
     prj.commit('foo_modified')
     self.assertEqual(prj._status('foo'), ' ')
     pkg = prj.package('foo_modified')
     self.assertEqual(pkg.status('file'), ' ')
     self.assertEqual(pkg.status('add'), ' ')
     self._not_exists(path, '.osc', '_transaction')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:16,代码来源:test_project.py

示例9: test19

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test19(self):
     """test remove (all files removed)"""
     path = self.fixture_file('prj2')
     prj = Project(path)
     pkg = prj.package('foo')
     self.assertEqual(pkg.status('file'), ' ')
     self.assertEqual(prj._status('foo'), ' ')
     self._exists(path, 'foo', 'file')
     prj.remove('foo')
     self._exists(path, 'foo')
     self._not_exists(path, 'foo', 'file')
     self.assertEqual(prj._status('foo'), 'D')
     pkg = prj.package('foo')
     self.assertEqual(pkg.status('file'), 'D')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:16,代码来源:test_project.py

示例10: test_commit12

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit12(self):
     """test commit (rollback update transaction)"""
     path = self.fixture_file('prj3_commit_rollback_update')
     self._exists(path, '.osc', '_transaction')
     # similar to test_commit6 - except that we rollback an update
     # transaction (behind the scenes)
     prj = Project(path)
     pkg = prj.package('conflict')
     self.assertEqual(pkg.status('conflict'), 'C')
     self.assertEqual(prj._status('conflict'), ' ')
     self.assertRaises(FileConflictError, prj.commit, 'conflict')
     self.assertEqual(prj._status('conflict'), ' ')
     pkg = prj.package('conflict')
     self.assertEqual(pkg.status('conflict'), 'C')
     self._not_exists(path, '.osc', '_transaction')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:17,代码来源:test_project.py

示例11: test_commit10

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_commit10(self):
     """test commit (specify file + comment; local state 'A')"""
     path = self.fixture_file('prj2')
     prj = Project(path)
     pkg = prj.package('bar')
     self.assertEqual(pkg.status('add'), 'A')
     self.assertEqual(pkg.status('add2'), 'A')
     self.assertEqual(prj._status('bar'), 'A')
     todo = {'bar': ['add']}
     prj.commit(package_filenames=todo, comment='foo')
     self.assertEqual(prj._status('bar'), ' ')
     pkg = prj.package('bar')
     self.assertEqual(pkg.status('add'), ' ')
     self.assertEqual(pkg.status('add2'), 'A')
     self._exists(path, '.osc', 'data', 'bar')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:17,代码来源:test_project.py

示例12: test_revert5

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_revert5(self):
     """revert a deleted package (dir does not exist)"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('del'), 'D')
     self._not_exists(path, 'del')
     prj.revert('del')
     self.assertEqual(prj._status('del'), ' ')
     self._exists(path, 'del')
     pkg = prj.package('del')
     self.assertEqual(pkg.status('file'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:13,代码来源:test_project.py

示例13: test_repair2

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 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'))
开发者ID:scarabeusiv,项目名称:osc2,代码行数:13,代码来源:test_project.py

示例14: test_revert6

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_revert6(self):
     """revert a package whose storedir was deleted"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('modified_no_storedir'), ' ')
     self._not_exists(path, 'modified_no_storedir', '.osc')
     prj.revert('modified_no_storedir')
     self._exists(path, 'modified_no_storedir', '.osc')
     self.assertEqual(prj._status('modified_no_storedir'), ' ')
     pkg = prj.package('modified_no_storedir')
     self.assertEqual(pkg.status('add'), '?')
     self.assertEqual(pkg.status('file'), ' ')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:14,代码来源:test_project.py

示例15: test_revert4

# 需要导入模块: from osc2.wc.project import Project [as 别名]
# 或者: from osc2.wc.project.Project import package [as 别名]
 def test_revert4(self):
     """revert a deleted package (dir exists)"""
     path = self.fixture_file('prj_revert')
     prj = Project(path)
     self.assertEqual(prj._status('deleted'), 'D')
     self._exists(path, 'deleted')
     pkg = prj.package('deleted')
     self.assertEqual(pkg.status('dummy'), 'D')
     self.assertEqual(pkg.status('foo'), 'D')
     self.assertEqual(pkg.status('modified'), 'D')
     self.assertEqual(pkg.status('untracked'), '?')
     prj.revert('deleted')
     self.assertEqual(prj._status('deleted'), ' ')
     self._exists(path, 'deleted')
     pkg = prj.package('deleted')
     self.assertEqual(pkg.status('dummy'), ' ')
     self.assertEqual(pkg.status('foo'), ' ')
     # this file is modified and its old state was 'D'
     # so the new state is 'M' (after the revert)
     self.assertEqual(pkg.status('modified'), 'M')
     # untracked files are kept
     self.assertEqual(pkg.status('untracked'), '?')
开发者ID:scarabeusiv,项目名称:osc2,代码行数:24,代码来源:test_project.py


注:本文中的osc2.wc.project.Project.package方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。