Skip to content

Commit

Permalink
removed tests where services are part of dependency tree - see #277
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <[email protected]>
  • Loading branch information
madpah committed Jul 27, 2022
1 parent e7fbca6 commit e631aaf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
24 changes: 12 additions & 12 deletions tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,18 @@ def get_bom_for_issue_275_components() -> Bom:
return bom


def get_bom_for_issue_275_services() -> Bom:
app = Component(name="app", version="1.0.0")
serv_a = Service(name='Service A')
serv_b = Service(name='Service B')
serv_c = Service(name='Service C')

serv_b.services.add(serv_c)
serv_b.dependencies.add(serv_c.bom_ref)

bom = Bom(services=[serv_a, serv_b])
bom.metadata.component = app
return bom
# def get_bom_for_issue_275_services() -> Bom:
# app = Component(name="app", version="1.0.0")
# serv_a = Service(name='Service A')
# serv_b = Service(name='Service B')
# serv_c = Service(name='Service C')
#
# serv_b.services.add(serv_c)
# serv_b.dependencies.add(serv_c.bom_ref)
#
# bom = Bom(services=[serv_a, serv_b])
# bom.metadata.component = app
# return bom


def get_component_setuptools_complete(include_pedigree: bool = True) -> Component:
Expand Down
14 changes: 6 additions & 8 deletions tests/test_model_bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@

from unittest import TestCase

from data import get_bom_for_issue_275_components, get_bom_with_component_setuptools_with_vulnerability

from cyclonedx.model import License, LicenseChoice, OrganizationalContact, OrganizationalEntity, Property
from cyclonedx.model.bom import Bom, BomMetaData, ThisTool, Tool
from cyclonedx.model.component import Component, ComponentType
from tests.data import get_bom_for_issue_275_services
from data import get_bom_for_issue_275_components, get_bom_with_component_setuptools_with_vulnerability


class TestBomMetaData(TestCase):
Expand Down Expand Up @@ -124,8 +122,8 @@ def test_bom_nested_components_issue_275(self) -> None:
self.assertEqual(2, len(bom.components))
bom.validate()

def test_bom_nested_services_issue_275(self) -> None:
bom = get_bom_for_issue_275_services()
self.assertIsInstance(bom.metadata.component, Component)
self.assertEqual(2, len(bom.services))
bom.validate()
# def test_bom_nested_services_issue_275(self) -> None:
# bom = get_bom_for_issue_275_services()
# self.assertIsInstance(bom.metadata.component, Component)
# self.assertEqual(2, len(bom.services))
# bom.validate()

0 comments on commit e631aaf

Please sign in to comment.