Skip to main content
Answer

Unit testing for cognite extractors using pytest framework ---cogex based extractors

  • October 18, 2023
  • 2 replies
  • 62 views

Hi Team,

 

IS there any unit testing examples for cogex based extractors to test integration with rest api

Best answer by Andre Alves

As mentioned by @mathialo , you can simply refer to the pytest documentation for guidance. However, if you're looking for some examples, you can explore the Cognite GitHub repositories. Below is a simple example of a validation unit test in the Cognite Python SDK:

https://github.com/cognitedata/cognite-sdk-python/blob/master/tests/tests_unit/test_utils/test_validation.py

2 replies

  • Practitioner
  • October 19, 2023

In terms of testing it’s just a normal python codebase, so there is nothing special you need to do. Just follow pytest’s documentation as normal.


Andre Alves
MVP
Forum|alt.badge.img+14
  • MVP
  • Answer
  • October 20, 2023

As mentioned by @mathialo , you can simply refer to the pytest documentation for guidance. However, if you're looking for some examples, you can explore the Cognite GitHub repositories. Below is a simple example of a validation unit test in the Cognite Python SDK:

https://github.com/cognitedata/cognite-sdk-python/blob/master/tests/tests_unit/test_utils/test_validation.py