Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw committed Apr 20, 2024
1 parent 8d48675 commit f82a76e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions git_browse/tests/test_sourcegraph.py
Expand Up @@ -20,6 +20,12 @@ def setUp(self) -> None:
"asdf/qwer",
)
self.uber_obj.host_class = phabricator.PhabricatorHost
self.uber_obj_java = sourcegraph.SourcegraphHost(
typedefs.GitConfig("", "master"),
"code.uber.internal",
"lm/fievel",
)
self.uber_obj_java.host_class = phabricator.PhabricatorHost

def test_init(self) -> None:
self.assertEqual(self.obj.host, "github.com")
Expand Down Expand Up @@ -125,3 +131,12 @@ def test_uber_get_url_file(self) -> None:
sourcegraph.UBER_SOURCEGRAPH_URL
+ "code.uber.internal/uber-code/asdf-qwer/-/blob/zxcv",
)

def test_uber_java_code(self) -> None:
git_object = typedefs.FocusObject("zxcv")
url = self.uber_obj_java.get_url(git_object)
self.assertEqual(
url,
sourcegraph.UBER_SOURCEGRAPH_URL
+ "code.uber.internal/uber-code/java-code/-/blob/zxcv",
)

0 comments on commit f82a76e

Please sign in to comment.