Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

327 revise ngsi ld batch operation tests #334

Open
wants to merge 10 commits into
base: NGSI-LD
Choose a base branch
from

Conversation

SystemsPurge
Copy link
Collaborator

Also removed test duplicates that were present in the test cd ld test file
May not be 100% consistent due to some occasional internal problems in Orion LD that may need to be looked at more closely

@SystemsPurge SystemsPurge self-assigned this Oct 8, 2024
Copy link
Contributor

@djs0109 djs0109 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SystemsPurge I merged the test cases of test_ngsi_ld_entities.py intotest_ngsi_ld_cb.py. Let me know whether you have other opinions

@@ -50,7 +50,7 @@ def setUp(self) -> None:
'value': 20.0}
}
self.entity = ContextLDEntity(id='urn:ngsi-ld:my:id4', type='MyType', **self.attr)
self.fiware_header = FiwareLDHeader(ngsild_tenant=settings.FIWARE_SERVICE)
self.fiware_header = FiwareLDHeader()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SystemsPurge why we don't use the value from settings?


client.entity_batch_operation(action_type=ActionTypeLD.DELETE, entities=entities_a)
client.entity_batch_operation(action_type=ActionTypeLD.DELETE, entities=entities_b)
self.assertLessEqual(len(self.client.get_entity_list(limit=1)), 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should these codes be put into the doc strings?

entity_list = self.cb_client.get_entity_list(entity_type=entity_type)
for entity in entity_list:
self.cb_client.delete_entity_by_id(entity_id=entity.id)
entity_list = self.cb_client.get_entity_list(entity_type="filip:object:test")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SystemsPurge, can you use a similar function as in test_ngsi_ld_cb.py?

range(0, 5)]

self.cb_client.entity_batch_operation(entities=entities_a, action_type=ActionTypeLD.CREATE)

entities_update = [ContextLDEntity(id=f"urn:ngsi-ld:test:{str(i)}",
type=f'filip:object:TypeUpdate') for i in
type=f'filip:object:test',
**{'temperature': {'value': self.r.randint(0,20)}}) for i in
range(3, 6)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it on purpose to have an unknown entity here? i.e. urn:ngsi-ld:test:5?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants