repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import pytest |
| #2 | |
| #3 | from embedchain.loaders.github import GithubLoader |
| #4 | |
| #5 | |
| #6 | @pytest.fixture |
| #7 | def mock_github_loader_config(): |
| #8 | return { |
| #9 | "token": "your_mock_token", |
| #10 | } |
| #11 | |
| #12 | |
| #13 | @pytest.fixture |
| #14 | def mock_github_loader(mocker, mock_github_loader_config): |
| #15 | mock_github = mocker.patch("github.Github") |
| #16 | _ = mock_github.return_value |
| #17 | return GithubLoader(config=mock_github_loader_config) |
| #18 | |
| #19 | |
| #20 | def test_github_loader_init(mocker, mock_github_loader_config): |
| #21 | mock_github = mocker.patch("github.Github") |
| #22 | GithubLoader(config=mock_github_loader_config) |
| #23 | mock_github.assert_called_once_with("your_mock_token") |
| #24 | |
| #25 | |
| #26 | def test_github_loader_init_empty_config(mocker): |
| #27 | with pytest.raises(ValueError, match="requires a personal access token"): |
| #28 | GithubLoader() |
| #29 | |
| #30 | |
| #31 | def test_github_loader_init_missing_token(): |
| #32 | with pytest.raises(ValueError, match="requires a personal access token"): |
| #33 | GithubLoader(config={}) |
| #34 |