Skip to content

Commit f4f2163

Browse files
committed
Add tests to demonstrate issue 251
1 parent a994678 commit f4f2163

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

testing/test_git.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ def test_git_archive_subdirectory(wd):
138138
assert integration.find_files('.') == [opj('.', 'foobar', 'test1.txt')]
139139

140140

141+
@pytest.mark.issue(251)
142+
def test_git_archive_run_from_subdirectory(wd):
143+
wd('mkdir foobar')
144+
wd.write('foobar/test1.txt', 'test')
145+
wd('git add foobar')
146+
wd.commit()
147+
with (wd.cwd / 'foobar').as_cwd():
148+
assert integration.find_files('.') == [opj('.', 'test1.txt')]
149+
150+
141151
def test_git_feature_branch_increments_major(wd):
142152
wd.commit_testfile()
143153
wd("git tag 1.0.0")

testing/test_mercurial.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ def test_archival_to_version(expected, data):
4141
def test_find_files_stop_at_root_hg(wd):
4242
wd.commit_testfile()
4343
wd.cwd.ensure('project/setup.cfg')
44+
# setup.cfg has not been committed
4445
assert integration.find_files(str(wd.cwd / 'project')) == []
46+
# issue 251
47+
wd.add_and_commit()
48+
with (wd.cwd / 'project').as_cwd():
49+
assert integration.find_files() == ['setup.cfg']
4550

4651

4752
# XXX: better tests for tag prefixes

0 commit comments

Comments
 (0)