Skip to content

Commit

Permalink
- test.wc.test_util: added testcase for wc_parent
Browse files Browse the repository at this point in the history
In a non-standard package hierarchy, wc_parent should resolve to the
correct parent working copy. Note: such a hierarchy is not created by
default.
  • Loading branch information
marcus-h committed Dec 12, 2014
1 parent c2d1121 commit de2f925
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/wc/test_util.py
Expand Up @@ -214,6 +214,18 @@ def test29(self):
par_dir = wc_parent(path)
self.assertIsNone(par_dir)

def test30(self):
"""test wc_parent in non-standard hierarchy"""
# currently, such a hierarchy is not created by osc2
# but we should resolve the parent with the help of
# the storedir link
path = self.fixture_file('prj1', 'hierarchy', 'non-standard')
self.assertTrue(wc_is_package(path))
par_dir = wc_parent(path)
self.assertIsNotNone(par_dir)
self.assertTrue(wc_is_project(par_dir))
self.assertEqual(wc_read_project(par_dir), 'prj1')

def test_wc_init1(self):
"""simple init wc"""
path = self.fixture_file('init')
Expand Down
1 change: 1 addition & 0 deletions test/wc/test_util_fixtures/prj1/.osc/_packages
@@ -1,4 +1,5 @@
<packages>
<package name="added" state="A"/>
<package name="missing" state="D"/>
<package name="non-standard" state=" "/>
</packages>
@@ -0,0 +1 @@
http://apiurl
3 changes: 3 additions & 0 deletions test/wc/test_util_fixtures/prj1/.osc/data/non-standard/_files
@@ -0,0 +1,3 @@
<directory name="non-standard" rev="87" srcmd5="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">
<entry name="dummy" md5="809db8de8a84816fd23862786baa1d75" mtime="1310328970" size="31"/>
</directory>
@@ -0,0 +1 @@
non-standard
@@ -0,0 +1 @@
prj1
@@ -0,0 +1 @@
dummy file (to make git happy)

0 comments on commit de2f925

Please sign in to comment.