-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testing still does not work well, because `__eq__` and `__len__` have not been implemented (properly)
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
import numpy as np | ||
import pytest | ||
from eitprocessing.eit_data.draeger import DraegerEITData | ||
|
||
|
||
environment = os.environ.get( | ||
"EIT_PROCESSING_TEST_DATA", | ||
os.path.abspath(os.path.dirname(os.path.dirname(__file__))), | ||
) | ||
data_directory = os.path.join(environment, "test_data") | ||
draeger_file1 = os.path.join(data_directory, "Draeger_Test3.bin") | ||
draeger_file2 = os.path.join(data_directory, "Draeger_Test.bin") | ||
timpel_file = os.path.join(data_directory, "Timpel_Test.txt") | ||
dummy_file = os.path.join(data_directory, "not_a_file.dummy") | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def draeger_data1(): | ||
return DraegerEITData.from_path(draeger_file1) | ||
|
||
|
||
def test_slicing(draeger_data1): | ||
cutoff = 10 | ||
data: DraegerEITData = draeger_data1 | ||
|
||
assert data[cutoff] == data[cutoff] | ||
assert data[0:cutoff] == data[:cutoff] | ||
# assert data[cutoff : len(data)] == data[cutoff:] | ||
|
||
# assert Sequence.merge(data[:cutoff], data[cutoff:]) == data | ||
# assert len(data[:cutoff]) == cutoff | ||
|
||
# assert len(data) == len(data[cutoff:]) + len(data[-cutoff:]) | ||
# assert len(data) == len(data[:cutoff]) + len(data[:-cutoff]) |