Skip to content

Commit

Permalink
changed name of test
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Adenekan committed Feb 3, 2022
1 parent 4dd6791 commit c25c6aa
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion rec_to_binaries/test/e2etests/test_adjust_timestamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@pytest.mark.skip(reason='not implemented')
def test_fix_timestamp_lag_check_if_data_is_written_no_systime(e2etests_directory_path, clear_file_content):
# # arrange
# file_path = f'{e2etests_directory_path}/test_data/fix_timestamp_lag_check_if_data_is_written_no_systime.dat'
# file_path = f'{e2etests_directory_path}/test_data/fix_timestamp_lag_check_if_data_is_written_no_systime.txt'
# clear_file_content(file_path)
# fake_data = np.array([
# ('just', 1),
Expand Down
18 changes: 9 additions & 9 deletions rec_to_binaries/test/e2etests/test_binary_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
)

def test_TrodesBinaryReader_first_line_not_Start_settings_error(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesBinaryReader_test_first_line_exception.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesBinaryReader_test_first_line_exception.txt'

with pytest.raises(TrodesBinaryFormatError) as ex:
trodes_binary_reader = TrodesBinaryReader(file_path)


def test_TrodesBinaryReader_more_than_1000_length_error(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesBinaryReader_test_more_than_1000_line_exception.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesBinaryReader_test_more_than_1000_line_exception.txt'

with pytest.raises(TrodesBinaryFormatError):
trodes_binary_reader = TrodesBinaryReader(file_path)

def test_TrodesBinaryReader_check_if_valid_file_is_read(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesBinaryReader_check_if_valid_file_is_read.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesBinaryReader_check_if_valid_file_is_read.txt'
trodes_binary_reader = TrodesBinaryReader(file_path)

assert trodes_binary_reader.data_start_byte == 43
assert trodes_binary_reader.txta_start_byte == 43
assert trodes_binary_reader.header_params == {'a': '1', 'data': '2'}

def test_TrodesLFPBinaryLoader_check_if_file_can_be_read(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesLFPBinaryLoader_test_file_read.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesLFPBinaryLoader_test_file_read.txt'
trodes_LFP_binary_loader = TrodesLFPBinaryLoader(file_path)

assert trodes_LFP_binary_loader.header_params['Original_file'] == 'test_Original_file'
Expand All @@ -45,7 +45,7 @@ def test_TrodesLFPBinaryLoader_check_if_file_can_be_read(e2etests_directory_path
assert trodes_LFP_binary_loader.header_params['Fields'] == 'test_Fields'

def test_TrodesTimestampBinaryLoader_check_if_file_can_be_read(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesTimestampBinaryLoader_test_file_read.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesTimestampBinaryLoader_test_file_read.txt'
trodes_timestamp_binary_loader = TrodesTimestampBinaryLoader(file_path)

assert trodes_timestamp_binary_loader.header_params['Byte_order'] == 'test_Byte_order'
Expand All @@ -56,7 +56,7 @@ def test_TrodesTimestampBinaryLoader_check_if_file_can_be_read(e2etests_director
assert trodes_timestamp_binary_loader.header_params['Fields'] == 'test_Fields'

def test_TrodesSpikeBinaryLoader_check_if_data_file_is_read(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesSpikeBinaryLoader_test_file_read.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesSpikeBinaryLoader_test_file_read.txt'
trodes_spike_binary_loader = TrodesSpikeBinaryLoader(file_path)


Expand All @@ -79,7 +79,7 @@ def test_TrodesSpikeBinaryLoader_check_if_data_file_is_read(e2etests_directory_p

@pytest.mark.skip(reason="I have to figure out why pos_list stays empty")
def test_TrodesPosBinaryLoader_check_if_data_file_is_read(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesPosBinaryLoader_check_if_data_file_is_read.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesPosBinaryLoader_check_if_data_file_is_read.txt'
trodes_pos_binary_loader = TrodesPosBinaryLoader(file_path)

breakpoint()
Expand All @@ -93,7 +93,7 @@ def test_TrodesPosBinaryLoader_check_if_data_file_is_read(e2etests_directory_pat

@pytest.mark.skip(reason="I have to figure out why pos_list stays empty")
def test_TrodesDIOBinaryLoader_check_if_data_file_is_read(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/TrodesPosBinaryLoader_check_if_data_file_is_read.dat'
file_path = f'{e2etests_directory_path}/test_data/TrodesPosBinaryLoader_check_if_data_file_is_read.txt'
trodes_pos_binary_loader = TrodesDIOBinaryLoader(file_path)

assert True
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Start settings>
a:1
data:2
threshold:test_threshold
dark:test_dark
clockrate:test_clockrate
field_str:test_Fields
<End settings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Start settings>
a:1
data:2
Original_file:test_Original_file
nTrode_ID:1
num_channels:10
Clock rate:3
Voltage_scaling:v
Time_offset:4
Threshold:5
Spike_invert:t
Reference:6
ReferenceNTrode:7
ReferenceChannel:8
Filter:t
lowPassFilter:y
highPassFilter:n
Fields:test_field
<End settings>
4 changes: 2 additions & 2 deletions rec_to_binaries/test/e2etests/test_read_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def test_write_trodes_extracted_datafile(e2etests_directory_path, clear_file_con
assert file_lines[3] == '\x04\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00'

def test_readTrodesExtractedDataFile_check_first_line_for_Start_settings(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/readTrodesExtractDataFile_not_start_setting.dat'
file_path = f'{e2etests_directory_path}/test_data/readTrodesExtractDataFile_not_start_setting.txt'

with pytest.raises(Exception):
readTrodesExtractedDataFile(file_path)

def test_readTrodesExtractedDataFile_check_file_is_written_correctly(e2etests_directory_path):
file_path = f'{e2etests_directory_path}/test_data/readTrodesExtractedDataFile_check_file_is_written_correctly.dat'
file_path = f'{e2etests_directory_path}/test_data/readTrodesExtractedDataFile_check_file_is_written_correctly.txt'
fields_text = readTrodesExtractedDataFile(file_path)

assert fields_text['a'] == '[1,2,3]'
Expand Down

0 comments on commit c25c6aa

Please sign in to comment.