def test_get_projects_filters(fc: fetcher.Fetcher, test_project_name): """fetchet.get_projects() should be able to filter on project.""" projects = fc.get_projects(test_project_name) assert isinstance(projects, list) assert len(projects) == 1 assert projects[0].name == test_project_name
def test_get_projects_throws_if_project_does_not_exist(fc: fetcher.Fetcher): """fetchet.get_projects() should error if filter is invalid""" with pytest.raises(exceptions.NotFoundError) as exc: fc.get_projects("BadProject") assert "An error occured while getting projects." in str(exc.value)
def test_get_projects_returns_projects(fc: fetcher.Fetcher): """fetcher.get_projects() should return a list of projects.""" projects = fc.get_projects() assert isinstance(projects, list) assert isinstance(projects[0], models.Project)