示例#1
0
def test_from_address():
    s = Source.from_address(
        SourceAddress("Github", repo="org/repo", subpath="a/folder"))
    assert isinstance(s, GithubSource)
    assert s.repo == "org/repo"
    assert s.subpath == "a/folder"

    s = Source.from_address("github://org/repo")
    assert isinstance(s, GithubSource)
    assert s.repo == "org/repo"
    assert s.subpath is None