def test_create_repo_node_and_get_cve_error_status_code(_mock_post): """Test the method RepoDependencyCreator.create_repo_node_and_get_cve.""" github_repo = "test_repository" deps_list = {"direct": [], "transitive": []} with pytest.raises(Exception) as e: RepoDependencyCreator.create_repo_node_and_get_cve( github_repo, deps_list) assert e is not None
def test_create_repo_node_and_get_cve_transitive_dependency_epv_only( _mock_post): """Test the method RepoDependencyCreator.create_repo_node_and_get_cve.""" github_repo = "test_repository" # use EPV only on transitive dependency deps_list = {"direct": [], "transitive": ["xxx:yyy:zzz"]} x = RepoDependencyCreator.create_repo_node_and_get_cve( github_repo, deps_list) assert x is not None
def test_create_repo_node_and_get_cve_direct_dependency(_mock_post): """Test the method RepoDependencyCreator.create_repo_node_and_get_cve.""" github_repo = "test_repository" # only direct dependency list is filled in # transitive dependencies list is empty deps_list = {"direct": ["xxx:yyy:zzz:www"], "transitive": []} x = RepoDependencyCreator.create_repo_node_and_get_cve( github_repo, deps_list) assert x is not None
def test_create_repo_node_and_get_cve(_mock_post): """Test the method RepoDependencyCreator.create_repo_node_and_get_cve.""" github_repo = "test_repository" # direct dependencies list is empty # transitive dependencies list is empty as well deps_list = {"direct": [], "transitive": []} x = RepoDependencyCreator.create_repo_node_and_get_cve( github_repo, deps_list) assert x is not None
def test_create_repo_node_and_get_cve_transitive_dependencies(_mock_post): """Test the method RepoDependencyCreator.create_repo_node_and_get_cve.""" github_repo = "test_repository" deps_list = { "direct": [], "transitive": ["xxx:yyy:zzz:www", "x2:y2:z2:w2"] } x = RepoDependencyCreator.create_repo_node_and_get_cve( github_repo, deps_list) assert x is not None