mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
fix: make test_get_rel_fname compatible with Windows
This commit is contained in:
parent
6152a82513
commit
41e8f4401e
1 changed files with 4 additions and 3 deletions
|
@ -26,10 +26,11 @@ class TestLinter(unittest.TestCase):
|
||||||
self.assertEqual(self.linter.languages["javascript"], "eslint")
|
self.assertEqual(self.linter.languages["javascript"], "eslint")
|
||||||
|
|
||||||
def test_get_rel_fname(self):
|
def test_get_rel_fname(self):
|
||||||
|
import os
|
||||||
self.assertEqual(self.linter.get_rel_fname("/test/root/file.py"), "file.py")
|
self.assertEqual(self.linter.get_rel_fname("/test/root/file.py"), "file.py")
|
||||||
self.assertEqual(
|
expected_path = os.path.normpath("../../other/path/file.py")
|
||||||
self.linter.get_rel_fname("/other/path/file.py"), "../../other/path/file.py"
|
actual_path = os.path.normpath(self.linter.get_rel_fname("/other/path/file.py"))
|
||||||
)
|
self.assertEqual(actual_path, expected_path)
|
||||||
|
|
||||||
@patch("subprocess.Popen")
|
@patch("subprocess.Popen")
|
||||||
def test_run_cmd(self, mock_popen):
|
def test_run_cmd(self, mock_popen):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue