hydrus icon indicating copy to clipboard operation
hydrus copied to clipboard

Tests for column datatypes in DB Models

Open chrizandr opened this issue 3 years ago • 2 comments

I'm submitting a

  • [ ] bug report.
  • [ x] feature request.

Current Behaviour:

Tests need to be added for the database built by the DB Model and check if the column types match based on the API Documentation. We should note here that we only match xsd:integer/float, all others should be varchar.

Expected Behaviour:

Steps to reproduce:

Snapshot:

Environment:

  • python version
  • pip version
  • OS details

Do you want to work on this issue?

chrizandr avatar Jul 06 '21 14:07 chrizandr

@chrizandr The docs that we're currently using for tests don't have any supported property with range xsd:integer or float . But still to test the behaviour I've made changes in gen_dummy_object function in conftest.py ( commit dc5f7c2a ) to make sure that a random integer/float is returned if Column type in database is integer/float. This behavior is being tested throughout test cases as we're using it in test_app.py and test_crud.py in hydrus.

Couldn't find any other way to test column types. What else should we add here ?

farazkhanfk7 avatar Jul 07 '21 13:07 farazkhanfk7

Ideally it should be a test to see if xsd:float is given in the documentation, then is the column for that property created with the correct datatype or not.

I noticed that we don't have any properties in the current API documentation, let's leave this for now till we have a better API doc to test

chrizandr avatar Jul 09 '21 07:07 chrizandr