Commit 467167ca authored by Vincent Michel's avatar Vincent Michel

Add interface tests

parent f15c7cdb
Pipeline #749 failed with stages
in 13 seconds
import pytest
import mock
@pytest.fixture
def interface():
with mock.patch('cffi.FFI.dlopen') as dlopen:
from handel import interface
interface.handel = dlopen.return_value
yield interface
def test_init(interface):
m = interface.handel.xiaInit
m.return_value = 0
assert interface.init('somefile') is None
m.assert_called_with('somefile')
def test_init_handel(interface):
m = interface.handel.xiaInitHandel
m.return_value = 0
assert interface.init_handel() is None
m.assert_called_with()
def test_new_detector(interface):
m = interface.handel.xiaNewDetector
m.return_value = 0
assert interface.new_detector('somealias') is None
m.assert_called_with('somealias')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment