tests package

Submodules

tests.compare_headers module

tests.compare_headers.compare_geometry_headers(self, hdr, newhdr)[source]
tests.compare_headers.compare_headers(self, hdr, newhdr, uid=True)[source]
tests.compare_headers.compare_optional(self, a, b, attr)[source]
tests.compare_headers.compare_template_headers(self, hdr, newhdr, uid=True)[source]

tests.context module

tests.test_archive_file module

Test file archive

class tests.test_archive_file.TestArchiveFile(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_mimetype()[source]
test_new_archive()[source]
test_unknown_mimetype()[source]
test_unknown_url()[source]

tests.test_archive_zip module

Test zip archive

class tests.test_archive_zip.TestArchiveZip(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_mimetype()[source]
test_new_archive()[source]
test_unknown_mimetype()[source]
test_unknown_url()[source]

tests.test_axis module

class tests.test_axis.TestAxis(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_uniform_axis()[source]
test_uniform_length_axis()[source]
test_uniform_length_axis_step2()[source]
test_variable_axis()[source]
test_variable_axis2()[source]
test_variable_axis_rgb()[source]

tests.test_formats_dicom module

class tests.test_formats_dicom.TestDicomPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_copy_dicom_4D()[source]
test_read_dicom_3D_no_opt()[source]
test_read_dicom_4D()[source]
test_read_dicom_user_defined_TI()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_dicom_4D()[source]
test_write_dicom_4D_no_opt()[source]
test_write_single_directory()[source]
test_write_single_file()[source]
class tests.test_formats_dicom.TestDicomSlicing(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_slice_ellipsis_first()[source]
test_slice_ellipsis_last()[source]
test_slice_ellipsis_middle()[source]
test_slice_inplane()[source]
test_slice_time_z()[source]
test_slice_z()[source]
class tests.test_formats_dicom.TestDicomZipPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_zip()[source]
class tests.test_formats_dicom.TestWriteZipArchiveDicom(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_directories()[source]
test_read_two_files()[source]
class tests.test_formats_dicom.TestZipArchiveDicom(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_directories()[source]
test_read_two_files()[source]

tests.test_formats_dicom_color module

class tests.test_formats_dicom_color.TestDicomColor(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_dicom_color()[source]
test_write_dicom_color()[source]

tests.test_formats_dicom_template module

exception tests.test_formats_dicom_template.ShouldHaveFailed[source]

Bases: Exception

class tests.test_formats_dicom_template.TestDicomTemplate(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_dicom_geometry_cmdline()[source]
test_dicom_geometry_prog()[source]
test_dicom_temp_slice()[source]
test_dicom_tempgeom_cmdline()[source]
test_dicom_tempgeom_prog()[source]
test_dicom_template_cmdline()[source]
test_dicom_template_prog()[source]

tests.test_formats_dicom_zip module

Test zip archive

class tests.test_formats_dicom_zip.TestDicomZipRead(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_wildcard()[source]
test_read_two_files()[source]
test_read_two_files2()[source]
class tests.test_formats_dicom_zip.TestDicomZipWrite(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_itk module

Test writing data

class tests.test_formats_itk.TestFileArchiveItk(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_file_not_found()[source]
test_read_2D()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_3d_single_file()[source]
test_write_4d_single_directory()[source]
test_write_4d_single_directory_explicit()[source]
class tests.test_formats_itk.TestWritePluginITKSlice(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_3d_itk()[source]
test_write_3d_itk_no_opt()[source]
test_write_4d_itk()[source]
class tests.test_formats_itk.TestWritePluginItkTag(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_3d_itk()[source]
test_write_4d_itk()[source]
tests.test_formats_itk.list_files(startpath)[source]

tests.test_formats_itk_template module

exception tests.test_formats_itk_template.ShouldHaveFailed[source]

Bases: Exception

class tests.test_formats_itk_template.TestItkTemplate(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_itk_geometry_cmdline()[source]
test_itk_geometry_prog()[source]
test_itk_tempgeom_cmdline()[source]
test_itk_tempgeom_prog()[source]
test_itk_template_cmdline()[source]
test_itk_template_prog()[source]

tests.test_formats_itk_zip module

Test zip archive

class tests.test_formats_itk_zip.TestItkZipRead(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_files()[source]
class tests.test_formats_itk_zip.TestItkZipWrite(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_mat module

class tests.test_formats_mat.Test3DMatPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_2D()[source]
test_read_3d_mat_no_opt()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_3d_mat()[source]
test_write_3d_mat_no_opt()[source]
test_write_single_directory()[source]
test_write_single_file()[source]
test_zipread_all_files()[source]
test_zipread_single_directory()[source]
test_zipread_single_file()[source]
test_zipread_single_file_relative()[source]
test_zipread_single_file_wildcard()[source]
class tests.test_formats_mat.Test4DMatPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_4d_mat()[source]
tests.test_formats_mat.list_files(startpath)[source]

tests.test_formats_mat_zip module

Test zip archive

class tests.test_formats_mat_zip.TestMatZipRead(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_files()[source]
class tests.test_formats_mat_zip.TestMatZipWrite(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_nifti module

class tests.test_formats_nifti.Test3DNIfTIPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_compare_qform_to_dicom()[source]
test_qform_3D()[source]
test_read_2D()[source]
test_read_3D()[source]
test_read_3d_nifti()[source]
test_read_3d_nifti_no_opt()[source]
test_read_single_file()[source]
test_read_two_files()[source]
test_write_3d_nifti_no_opt()[source]
test_write_single_file()[source]
test_zipread_all_files()[source]
test_zipread_single_directory()[source]
test_zipread_single_file()[source]
class tests.test_formats_nifti.Test4DNIfTIPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_4d_nifti()[source]

tests.test_formats_nifti_zip module

Test zip archive

class tests.test_formats_nifti_zip.TestNiftiZipRead(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_all_files()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_relative()[source]
test_read_single_file_wildcard()[source]
test_read_two_files()[source]
class tests.test_formats_nifti_zip.TestNiftiZipWrite(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_write_all_files()[source]
test_write_single_file()[source]

tests.test_formats_ps module

class tests.test_formats_ps.Test2DPSPlugin(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_read_large_file()[source]
test_read_single_directory()[source]
test_read_single_file()[source]
test_read_single_file_gray()[source]
test_read_two_files()[source]
test_write_single_directory()[source]
test_write_single_file()[source]
test_zipread_a_directory()[source]
test_zipread_all()[source]
test_zipread_single_file()[source]
test_zipread_two_files()[source]

tests.test_series module

class tests.test_series.TestSeries(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_assign_slice()[source]
test_assign_slice_x()[source]
test_copy_series()[source]
test_copy_series2()[source]
test_create_series()[source]
test_cross_talk()[source]
test_cross_talk_2()[source]
test_cross_talk_3()[source]
test_cross_talk_spacing()[source]
test_ellipsis_first()[source]
test_ellipsis_middle()[source]
test_get_keyword()[source]
test_increase_ndim()[source]
test_max()[source]
test_multiple_ellipses()[source]
test_print_header()[source]
test_repr()[source]
test_repr_vol()[source]
test_set_axes()[source]
test_slicing_dim()[source]
test_slicing_t()[source]
test_slicing_t_neg()[source]
test_slicing_x()[source]
test_slicing_x_neg()[source]
test_slicing_y()[source]
test_slicing_y_neg()[source]
test_slicing_z()[source]
test_slicing_z_neg()[source]
test_subtract_series()[source]

tests.test_transport_dicomtransport module

class tests.test_transport_dicomtransport.TestDicomTransport(methodName='runTest')[source]

Bases: unittest.case.TestCase

static handle_store(event)[source]

Store the pydicom Dataset ds.

Parameters

event (pydicom.event) –

Returns

status – The status returned to the peer AE in the C-STORE response. Must be a valid C-STORE status value for the applicable Service Class as either an int or a Dataset object containing (at a minimum) a (0000,0900) Status element.

Return type

int or pydicom.dataset.Dataset

setUp()[source]

Hook method for setting up the test fixture before exercising it.

setupDicomSCP(port=11112)[source]
tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_transport_cget_series()[source]
test_transport_single_image()[source]
test_transport_single_image_calling_aet()[source]
test_transport_walk()[source]

tests.test_transport_filetransport module

Test file archive

class tests.test_transport_filetransport.TestFiletransport(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_isfile()[source]
test_open_file()[source]
test_open_new()[source]
test_open_nonexist()[source]
test_open_nonexist_dir()[source]
test_readfile()[source]
test_walk()[source]
test_write_then_read()[source]

tests.test_version module

class tests.test_version.TestVersion(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_version()[source]

Module contents