This repository has been archived by the owner on Feb 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #540 from gamechanger/tnt-rel-path
Make a better attempt at parsing relative repo paths
- Loading branch information
Showing
3 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ class TestSource(DustyTestCase): | |
def setUp(self): | ||
super(TestSource, self).setUp() | ||
self.temp_dir = tempfile.mkdtemp() | ||
|
||
self.MockableRepo = type("MockableRepo", (Repo, object), {}) | ||
|
||
def tearDown(self): | ||
|
@@ -62,7 +61,25 @@ def test_managed_path_file(self): | |
self.assertEqual(Repo('file:///github.com/app/a').managed_path, '/etc/dusty/repos/github.com/app/a') | ||
|
||
def test_managed_path_ssh(self): | ||
self.assertEqual(Repo('ssh://[email protected]/app/a').managed_path, '/etc/dusty/repos/[email protected]/app/a') | ||
self.assertEqual(Repo('ssh://[email protected]/app/a').managed_path, '/etc/dusty/repos/github.com/app/a') | ||
|
||
def test_rel_path(self): | ||
self.assertEqual(Repo('github.com/app/a').rel_path, 'github.com/app/a') | ||
self.assertEqual(Repo('github.com/app/a.js').rel_path, 'github.com/app/a.js') | ||
self.assertEqual(Repo('/gc/repos/dusty').rel_path, 'gc/repos/dusty') | ||
|
||
def test_rel_path_http(self): | ||
self.assertEqual(Repo('http://github.com/app/a').rel_path, 'github.com/app/a') | ||
|
||
def test_rel_path_file(self): | ||
self.assertEqual(Repo('file:///github.com/app/a.git').rel_path, 'github.com/app/a') | ||
self.assertEqual(Repo('file:///github.com/app/a.js.git').rel_path, 'github.com/app/a.js') | ||
|
||
def test_rel_path_ssh(self): | ||
self.assertEqual(Repo('ssh://[email protected]/app/a.git').rel_path, 'github.com/app/a') | ||
self.assertEqual(Repo('ssh://[email protected]:2222/app/a').rel_path, 'github.com/app/a') | ||
self.assertEqual(Repo('ssh://[email protected]:2222/app/a.js').rel_path, 'github.com/app/a.js') | ||
self.assertEqual(Repo('ssh://[email protected]:2222/app/a.js.git').rel_path, 'github.com/app/a.js') | ||
|
||
def test_override_path(self): | ||
override_repo('github.com/app/a', self.temp_dir) | ||
|