Skip to content

Commit

Permalink
Merge pull request #449 from bfueldner/develop
Browse files Browse the repository at this point in the history
Make reference file detection under windows work with linux-created requirements
  • Loading branch information
stanislaw committed Feb 17, 2020
2 parents 5ab3c4c + 7fbe9b9 commit b389940
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doorstop/core/reference_finder.py
Expand Up @@ -70,7 +70,7 @@ def find_file_reference(ref_path, root, tree, item_path, keyword=None):
"""

log.debug("searching for ref '{}'...".format(ref_path))
ref_full_path = os.path.join(root, ref_path)
ref_full_path = os.path.normpath(os.path.join(root, ref_path))

for path, filename, relpath in tree.vcs.paths:
# Skip the item's file while searching
Expand Down
6 changes: 3 additions & 3 deletions doorstop/core/tests/test_item.py
Expand Up @@ -633,11 +633,11 @@ def test_find_references(self):
self.assertEqual(2, len(ref))

relpath_1, keyword_line_1 = ref[0]
self.assertEqual(relpath_1, 'files/REQ001.yml')
self.assertEqual(relpath_1, os.path.join('files', 'REQ001.yml'))
self.assertEqual(keyword_line_1, None)

relpath_2, keyword_line_2 = ref[1]
self.assertEqual(relpath_2, 'files/REQ002.yml')
self.assertEqual(relpath_2, os.path.join('files', 'REQ002.yml'))
self.assertEqual(keyword_line_2, None)

@patch('doorstop.settings.CACHE_PATHS', False)
Expand All @@ -657,7 +657,7 @@ def test_find_references_valid_keyword(self):
self.assertEqual(1, len(ref))

ref_path, ref_keyword_line = ref[0]
self.assertEqual(ref_path, 'files/REQ001.yml')
self.assertEqual(ref_path, os.path.join('files', 'REQ001.yml'))
self.assertEqual(ref_keyword_line, 12)

@patch('doorstop.settings.CACHE_PATHS', False)
Expand Down
6 changes: 3 additions & 3 deletions doorstop/core/tests/test_reference_finder.py
Expand Up @@ -35,7 +35,7 @@ def test_find_file_reference_no_keyword(self):
)

# Assert
self.assertEqual(path, 'files/REQ001.yml')
self.assertEqual(path, os.path.join('files', 'REQ001.yml'))
self.assertEqual(line, None)

def test_find_file_reference_with_keyword(self):
Expand All @@ -53,7 +53,7 @@ def test_find_file_reference_with_keyword(self):
)

# Assert
self.assertEqual(path, 'files/REQ006.yml')
self.assertEqual(path, os.path.join('files', 'REQ006.yml'))
self.assertEqual(line, 10)

def test_find_file_reference_should_skip_item_path(self):
Expand Down Expand Up @@ -86,7 +86,7 @@ def test_find_file_reference_valid_keyword_given(self):
)

# Assert
self.assertEqual(path, 'files/REQ001.yml')
self.assertEqual(path, os.path.join('files', 'REQ001.yml'))
self.assertEqual(line, 12)

def test_find_file_reference_invalid_keyword_given(self):
Expand Down

0 comments on commit b389940

Please sign in to comment.