Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Add unit-tests dedicated to cosimulation
Browse files Browse the repository at this point in the history
  • Loading branch information
xlz-jbleclere committed Feb 14, 2022
1 parent 21b79bb commit bb424a5
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions tests/test_cosimulation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
"""
Test metering and floating behaviors of DRM Library.
"""
import pytest
from time import sleep
from random import randint, choice
from datetime import datetime, timedelta
from re import search, findall
from os.path import realpath, isfile

from tests.conftest import wait_deadline, wait_func_true


def test_hybrid_fast_start_stop(accelize_drm, conf_json, cred_json, async_handler, log_file_factory):
"""
Test no error occurs witha quick start/stop
"""
driver = accelize_drm.pytest_fpga_driver[0]
async_cb = async_handler.create()
async_cb.reset()
activators = accelize_drm.pytest_fpga_activators[0]
activators.reset_coin()
activators.autotest()
cred_json.set_user('accelize_accelerator_test_06')
conf_json.reset()
logfile = log_file_factory.create(2)
conf_json['settings'].update(logfile.json)
conf_json['drm']['drm_software'] = True
conf_json.save()
with accelize_drm.DrmManager(
conf_json.path,
cred_json.path,
driver.read_register_callback,
driver.write_register_callback,
async_cb.callback
) as drm_manager:
#assert not drm_manager.get('license_status')
#activators.autotest(is_activated=False)
drm_manager.activate()
drm_manager.deactivate()
#assert not drm_manager.get('license_status')
#activators.autotest(is_activated=False)
#assert sum(drm_manager.get('metered_data')) == 0
#async_cb.assert_NoError()
logfile.remove()

0 comments on commit bb424a5

Please sign in to comment.