Solved

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

  • 18 October 2023
  • 2 replies
  • 42 views

Hi Team,

 

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

icon

Best answer by Andre Alves 20 October 2023, 16:45

View original

2 replies

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.

Userlevel 4
Badge +5

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

Reply