ghub/ghub_tests.py
2021-11-04 22:59:03 -04:00

26 lines
518 B
Python

import json
import pytest
from ghub import GHub
def _load_user():
with open("./tests/fixtures/user.json", "r") as f:
return json.loads(f.read())
def _load_repos():
with open("./tests/fixtures/repos_1.json", "r") as f:
return json.loads(f.read())
def _fake_tyrel() -> GHub:
gh = GHub()
gh.user = _load_user()
gh.repos = _load_repos()
return gh
def test_load_repos():
gh = _fake_tyrel()
assert gh.repos[0]["git_url"] == "git://github.com/tyrelsouza/genealogy.git"