def test_from_json(self): json_repo = {'name': 'repo_name', 'owner': {'login': '******'} } org = Organization('org_name') repo = Repo('repo_name', org) self.assertEqual(repo, Repo.from_json(json_repo))
def test_get_repos(self, mock_map, *_): mock_map.return_value = \ [[{'name': 'cloudify-manager', 'owner': {'login': '******'}}], [{'name': 'cloudify-ui', 'owner': {'login': '******'}}]] org = Organization('cloudify-cosmo') expected_result = [Repo('cloudify-manager', org=org), Repo('cloudify-ui', org=org)] result = Repo.get_repos(org) self.assertEqual(result, expected_result)