omf-python icon indicating copy to clipboard operation
omf-python copied to clipboard

Tests failed with errors

Open rminhxm opened this issue 6 years ago • 1 comments

This is my first time trying this project. The setup and dependencies installation seem OK but the test run failed with errors.

Test result attached.

OS: Window 7 Professional x64 Python 3.7.0 (tried x64 version, same errors) The latest omf revision test_result.txt

rminhxm avatar May 21 '19 21:05 rminhxm

Found the cause of the failures, but do not have the permissions to push the fixes.

For test_base.py:

  • put a tenth of second sleep before change the model to get the modified datetime that fixed the assert model.date_modified > date_modified in test_modify and test_validate_updates
    model = MyModelWithInt()
    date_created = model.date_created
    date_modified = model.date_modified
    time.sleep(.1)
    model.my_int = 0
    assert model.date_created == date_created
    assert model.date_modified > date_modified

For test_serializer:

  • randint() creates type 'int32' by default while omf'd default is 'int64', so this did the trick:
    np.random.randint(100, size=[4, 5, 6], dtype='int64'),
    np.random.randint(100, size=[3], dtype='int64'),

rminhxm avatar May 23 '19 00:05 rminhxm