class TestGithubConnector(unittest.TestCase): def setUp(self): self.conector = GithubConnector() @httpretty.activate def test__read_report(self): result = '[{"name": "scikit-aero"}]' httpretty.register_uri(httpretty.GET, "https://api.github.com/users/Pybonacci/repos", body=result, content_type="application/json") json_project = self.conector.read_all("Pybonacci") self.assertEqual(json_project, [{"name": "scikit-aero"}]) def test__create_github_url(self): url = self.conector._create_github_url("Pybonacci") self.assertEqual(url, "https://api.github.com/users/Pybonacci/repos")
def setUp(self): self.conector = GithubConnector()