Skip to content

Commit

Permalink
updated tests for v0.1.5. 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
andresperezlopez committed May 20, 2019
1 parent b17c165 commit f02e37e
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .coverage
@@ -1 +1 @@
!coverage.py: This is a private format, don't read it directly!{"lines":{"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASingleRoom.py":[38,39,41,43,44,46,62,63,69,70,71,73,74,75,77,78,79,80,82,83,84,88,89,90,94,95,96,97,99],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAFile.py":[38,39,40,41,42,43,44,45,46,47,48,50,52,53,55,57,63,64,66,67,68,70,77,78,79,80,81,82,83,84,85,86,87,88,90,93,98,100,105,107,114,115,117,123,125,133,134,135,136,138,144,146,154,155,156,157,159,167,168,169,170,173,179,182,189,190,192,194,202,203,204,205,208,216,217,218,219,221,229,230,231,232,234,242,243,244,245,247,256,257,258,259,264,272,273,274,275,276,277,282,287,289,294,296,301,303,308,310,315,317,322,324,329,331,336,339,344,346,351,353,358,360,365,367,372,374,379,382,387,389,394,396,401,403,408,410,416,418,423,427,432,434,439,441,446,448,453,455,460,462,467,469,474,476,481,483,488,490,495,497,502,504,509,512,517,519,524,526,531,534,539,541,546,548,553,556,560,561,562,564,568,569,572,579,580,581,582,584,586,590,591,596,604,605,606,607,609,611,618,619,621,624,632,633,634,635,636,637,640,641,642,643,644,645,646,647,648,649,650,651,653,655,664,665,666,667,671,672,673,674,675,676,678,679,682,684,685,686,687,688,689,690,692,694,695,696,697,699,702,711,712,713,714,718,719,720,721,722,723,725,726,727,728,729,730,731,733,735,736,737,738,739,740,741,743,745,746,747,748,750,753,762,763,764,765,769,770,771,772,773,774,776,777,778,779,780,781,782,784,786,787,788,789,790,791,792,794,796,797,798,799,800,801,804,813,814,815,816,820,821,822,823,824,825,827,828,829,830,831,832,833,835,837,838,839,840,841,842,843,845,847,848,849,850,851,853,855,863,864,865,866,868,869,870,871,873,875,878,879,881,882,884,885,887,888,891,901,902,903,904,908,909,910,911,913,914,915,919,920,921,922,924,925,926,930,932,933,935,936,940,941,942,943,945,946,947,949,952,962,963,964,965,966,969,970,971,972,974,975,976,980,981,982,983,985,986,987,991,993,994,996,997,1001,1002,1003,1004,1006,1007,1008,1010,1014,1024,1025,1026,1027,1030,1031,1032,1033,1035,1036,1037,1040,1041,1042,1043,1045,1046,1048,1051,1053,1054,1056,1057,1060,1061,1062,1063,1065,1066,1067,1069,1072,1081,1082,1083,1084,1087,1088,1089,1090,1092,1093,1095,1098,1099,1100,1101,1103,1104,1106,1109,1110,1111,1112,1114,1115,1117,1120,1122,1123,1125,1126,1128],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAListener.py":[129,131,137,139,145,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,81,82,85,86,89,90,91,94,95,96,98,101,109,111,119,121],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAVersion.py":[38,41,42,43,46,47],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAGeneralTF.py":[65,66,67,69,38,39,41,43,44,46,71,73,58,59,70],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAUnits.py":[128,130,131,133,136,145,146,147,149,150,151,153,179,184,185,162,163,164,38,39,168,41,170,43,44,45,46,47,48,49,51,180,181,54,55,56,57,58,60,61,62,63,65,66,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,86,87,88,89,90,91,92,93,95,96,97,98,99,100,166,103,167,112,113,114,115,116,119,183],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAGeneralFIRE.py":[65,66,71,69,38,39,41,43,44,46,67,73,58,59,70],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASimpleFreeFieldSOS.py":[38,39,41,43,44,46,62,63,69,70,71,73,74,75,77,78,79,82,83,84,87,88,89,90,92,93,94,95,97],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/__init__.py":[1,2,3,4,5,6,7,8,9],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAPositionVariable.py":[38,40,43,44,46,47,48,50,52,53,55,56,58,59,61,62,64,66,67,69,70,72],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAAPI.py":[38,40,42,43,45,51,53,61,63,65,71,73,79,81,87,89,95,97,104,106,108,114,116,122],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAAttributes.py":[38,39,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,115,118,119,121,129,130,133,141,142,144,152,153,155,163,164,165,167,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,272,273,274,275,276,279,280,281,282,283],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAAmbisonicsDRIR.py":[38,39,41,43,44,46,62,63,69,70,71,73,74,75,77,78,79,81,82,83,85,86,87,91,92,93,95,96,97,100],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAReceiver.py":[133,135,141,143,149,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,82,83,86,87,90,91,92,95,96,97,99,102,111,113,122,124],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASimpleFreeFieldHRIR.py":[38,39,41,43,44,46,63,64,70,71,72,74,75,76,78,79,80,82,83,84,86,87,88,91,92,93,94,96,97,98,99,101],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAWarning.py":[40,38,39],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAError.py":[40,38,39],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASimpleHeadphoneIR.py":[38,39,41,43,44,46,68,69,75,76,77,79,80,81,83,84,85,87,88,89,91,92,93,95,96,97,99,100,101,103,104,105,107,108,109,111,112,113,115,116,117,120,121,123,124,127],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAMultiSpeakerBRIR.py":[66,75,68,70,38,39,72,41,74,43,44,46,79,76,67,71,59,60],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAGeneralFIR.py":[65,66,71,69,38,39,41,43,44,46,67,73,58,59,70],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFANcFile.py":[129,43,179,257,145,137,138,139,140,142,143,144,92,146,148,150,158,159,161,219,38,39,168,41,171,44,45,47,200,178,51,53,59,188,61,169,71,69,70,199,72,74,203,204,206,208,82,105,217,90,91,220,93,222,95,224,80,103,104,233,234,235,108,237,239,114,116,106,247,249,124,125,126,127],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/__init__.py":[2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFASource.py":[129,131,137,139,145,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,81,82,85,86,89,90,91,94,95,96,98,101,109,111,119,121],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAEmitter.py":[133,135,141,143,149,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,82,83,86,87,90,91,92,95,96,97,99,102,111,113,122,124]}}
!coverage.py: This is a private format, don't read it directly!{"lines":{"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAFile.py":[38,40,41,42,43,44,45,46,47,48,49,53,55,56,58,60,64,65,67,68,69,71,78,79,80,81,82,83,84,85,86,87,88,89,91,94,99,101,106,108,115,116,118,124,126,134,135,136,137,139,145,147,155,156,157,158,160,168,169,170,171,174,180,183,190,191,193,195,203,204,205,206,209,217,218,219,220,222,230,231,232,233,235,243,244,245,246,248,257,258,259,260,262,270,271,272,273,274,275,280,285,287,292,294,299,301,306,308,313,315,320,322,327,329,334,337,342,344,349,351,356,358,363,365,370,372,377,380,385,387,392,394,399,401,406,408,414,416,421,424,429,431,436,438,443,445,450,452,457,459,464,466,471,473,478,480,485,487,492,494,499,501,506,509,514,516,521,523,528,531,536,538,543,545,550,553,557,558,559,561,565,566,569,576,577,578,579,581,583,587,588,593,601,602,603,604,606,608,615,616,618,620,628,629,630,631,632,633,636,637,638,639,640,641,642,643,644,645,646,647,649,651,660,661,662,663,666,667,668,669,670,671,673,674,677,679,680,681,683,684,685,686,688,690,691,692,693,695,697,706,707,708,709,713,714,715,716,717,718,720,721,724,726,727,728,730,731,732,733,735,737,738,739,740,742,744,753,754,755,756,760,761,762,763,764,765,767,768,769,770,771,772,773,775,777,778,779,780,781,782,783,785,787,788,789,790,791,792,794,803,804,805,806,810,811,812,813,814,815,817,818,819,820,821,822,823,825,827,828,829,830,831,832,833,835,837,838,839,840,841,843,845,853,854,855,856,858,859,860,861,863,865,868,869,871,872,874,875,877,878,881,891,892,893,894,897,898,899,900,902,903,904,907,908,909,910,912,913,914,917,919,920,922,923,926,927,928,929,931,932,933,935,938,948,949,950,951,952,955,956,957,958,960,961,962,965,966,967,968,970,971,972,975,977,978,980,981,984,985,986,987,989,990,991,993,996,1006,1007,1008,1009,1012,1013,1014,1015,1017,1018,1019,1022,1023,1024,1025,1027,1028,1030,1033,1035,1036,1038,1039,1042,1043,1044,1045,1047,1048,1049,1051,1054,1063,1064,1065,1066,1069,1070,1071,1072,1074,1075,1077,1080,1081,1082,1083,1085,1086,1088,1091,1092,1093,1094,1096,1097,1099,1102,1104,1105,1107,1108,1110],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAListener.py":[129,131,137,139,145,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,81,82,85,86,89,90,91,94,95,96,98,101,109,111,119,121],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAVersion.py":[39,41,42,43,46,47],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASingleRoomDRIR.py":[38,40,43,44,45,47,63,64,68,69,70,71,73,74,75,76,78,79,80,81,83,84,85,88,89,90,93,94,95,96,98],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAGeneralTF.py":[65,66,67,68,70,38,71,40,73,43,44,45,47,72,75,59,60],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAUnits.py":[128,130,131,133,136,145,146,147,149,150,151,153,179,184,185,162,163,164,38,39,168,41,170,43,44,45,46,47,48,49,51,180,181,54,55,56,57,58,60,61,62,63,65,66,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,86,87,88,89,90,91,92,93,95,96,97,98,99,100,166,103,167,112,113,114,115,116,119,183],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAGeneralFIRE.py":[65,66,75,68,70,38,71,40,73,43,44,45,47,72,67,59,60],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASimpleFreeFieldSOS.py":[38,40,43,44,45,47,63,64,69,70,71,72,74,75,76,77,79,80,81,82,84,85,86,89,90,91,92,94,95,96,97,99],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/__init__.py":[1,2,3,4,5,6,7,8,9],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAPositionVariable.py":[38,40,43,44,46,47,48,50,52,53,55,56,58,59,61,62,64,66,67,69,70,72],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAAPI.py":[38,40,42,43,45,51,53,61,63,65,71,73,79,81,87,89,95,97,104,106,108,114,116,122],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAAttributes.py":[38,39,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,115,118,119,121,129,130,133,141,142,144,152,153,155,163,164,165,167,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,272,273,274,275,276,279,280,281,282,283],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAAmbisonicsDRIR.py":[38,40,43,44,45,47,63,64,69,70,71,72,74,75,76,77,79,80,81,83,84,85,87,88,89,92,93,94,96,97,98,100],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAReceiver.py":[133,135,141,143,149,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,82,83,86,87,90,91,92,95,96,97,99,102,111,113,122,124],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASimpleFreeFieldHRIR.py":[38,40,43,44,45,47,64,65,70,71,72,73,75,76,77,78,80,81,82,83,85,86,87,89,90,91,94,95,96,97,99,100,101,102,104],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAWarning.py":[40,41,39],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAGeneralFIR.py":[65,66,75,68,70,38,71,40,73,43,44,45,47,72,67,59,60],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFASimpleHeadphoneIR.py":[128,38,40,43,44,45,47,69,70,75,76,77,78,80,81,82,83,85,86,87,88,90,91,92,94,95,96,98,99,100,102,103,104,106,107,108,110,111,112,114,115,116,118,119,120,123,124,125,126],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAConventions/SOFAMultiSpeakerBRIR.py":[80,66,67,68,69,38,71,40,73,74,43,44,45,77,47,76,72,78,60,61],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAError.py":[40,41,39],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFANcFile.py":[129,43,179,257,145,137,138,139,140,142,143,144,92,146,148,150,158,159,161,219,38,39,168,41,171,44,45,47,200,178,51,53,59,188,61,169,71,69,70,199,72,74,203,204,206,208,82,105,217,90,91,220,93,222,95,224,80,103,104,233,234,235,108,237,239,114,116,106,247,249,124,125,126,127],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/__init__.py":[2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFASource.py":[129,131,137,139,145,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,81,82,85,86,89,90,91,94,95,96,98,101,109,111,119,121],"/Users/andres.perez/source/pysofaconventions/pysofaconventions/SOFAEmitter.py":[133,135,141,143,149,38,39,41,43,46,47,48,50,53,60,61,63,64,66,69,82,83,86,87,90,91,92,95,96,97,99,102,111,113,122,124]}}
14 changes: 7 additions & 7 deletions tests/test_SOFAAmbisonicsDRIR.py
Expand Up @@ -115,33 +115,33 @@ def raiseWarning(warningString):
## Specific validity

# SOFAConventions should be AmbisonicsDRIR
raiseWarning('SOFAConventions is not AmbisonicsDRIR')
raiseWarning('SOFAConventions is not "AmbisonicsDRIR", got: "GeneralFIR"')
rootgrp = Dataset(path, 'a')
rootgrp.SOFAConventions = 'AmbisonicsDRIR'
rootgrp.close()

# Required global attribute AmbisonicsOrder
raiseWarning('Global Attribute AmbisonicsOrder not found')
raiseWarning('Missing required Global Attribute "AmbisonicsOrder"')
rootgrp = Dataset(path, 'a')
rootgrp.AmbisonicsOrder = 1
rootgrp.close()

# Required attribute Data.IR:ChannelOrdering
raiseWarning('Data.IR Attribute ChannelOrdering not found')
raiseWarning('Missing required Data.IR Attribute "ChannelOrdering"')
rootgrp = Dataset(path, 'a')
dataIR = rootgrp.variables['Data.IR']
dataIR.ChannelOrdering = 'fuma'
rootgrp.close()

# Required attribute Data.IR:Normalization
raiseWarning('Data.IR Attribute Normalization not found')
raiseWarning('Missing required Data.IR Attribute "Normalization"')
rootgrp = Dataset(path, 'a')
dataIR = rootgrp.variables['Data.IR']
dataIR.Normalization = 'fuma'
rootgrp.close()

# Requiered variables ListenerUp and ListenerView
raiseWarning('Mandatory Variables ListenerUp and ListenerView not found')
raiseWarning('Missing required Variables "ListenerUp" and "ListenerView"')
rootgrp = Dataset(path, 'a')
up = rootgrp.createVariable('ListenerUp','f8',('I','C'))
up.Units = 'metre'
Expand All @@ -152,7 +152,7 @@ def raiseWarning(warningString):
rootgrp.close()

# Requiered variables SourceUp and SourceView
raiseWarning('Mandatory Variables SourceUp and SourceView not found')
raiseWarning('Missing required Variables "SourceUp" and "SourceView"')
rootgrp = Dataset(path, 'a')
up = rootgrp.createVariable('SourceUp','f8',('I','C'))
up.Units = 'metre'
Expand Down Expand Up @@ -214,7 +214,7 @@ def raiseWarning(warningString):
rootgrp.close()

# Data type should be FIRE
raiseWarning('DataType is not FIRE')
raiseWarning('DataType is not "FIRE", got: "FIR"')



Expand Down

0 comments on commit f02e37e

Please sign in to comment.