''' Purpose: supports simple testing of the magnificent functions ''' # necessary modules to support the testing import url, magnificent # testing beans() length1, height1, volume1 = 1.52, 0.9, 500 length2, height2, volume2 = 2, 1, 25 count1 = magnificent.beans( length1, height1, volume1 ) count2 = magnificent.beans( length2, height2, volume2 ) print( count1, 'beans with length', length1, 'and height', height1, 'fits in a jar with volume', volume1 ) print( count2, 'beans with length', length2, 'and height', height2, 'fits in a jar with volume', volume2 ) print( '\n-------------------------------------------------------\n' ) # testing manhattan_distance() street1, avenue1, street2, avenue2 = 59, 6, 34, 7 distance = magnificent.manhattan_distance( avenue1, street1, avenue2, street2 ) print( 'Corners (', avenue1, ',', street1, ') and (', avenue2, ',', street2, ') are', distance, 'miles apart' ) street1, avenue1, street2, avenue2 = 47, 2, 238, 6 distance = magnificent.manhattan_distance( avenue1, street1, avenue2, street2 ) print( 'Corners (', avenue1, ',', street1, ') and (', avenue2, ',', street2, ') are', distance, 'miles apart' ) print( '\n-------------------------------------------------------\n' ) # testing relate() word1, word2 = 'kiwi', 'kiwi' relationship = magnificent.relate( word1, word2 ) print( word1, relationship, word2 ) word1, word2 = 'apple', 'banana' relationship = magnificent.relate( word1, word2 ) print( word1, relationship, word2 ) word1, word2 = 'orange', 'melon' relationship = magnificent.relate( word1, word2 ) print( word1, relationship, word2 ) print( '\n-------------------------------------------------------\n' ) # testing youngest() age1 = 19 age2 = 22 min_age1 = magnificent.youngest( age1 ) min_age2 = magnificent.youngest( age2 ) print( age1, 'year old can date a', min_age1, 'year old' ) print( age2, 'year old can date a', min_age2, 'year old' ) print( '\n-------------------------------------------------------\n' ) # testing is_dateable() age1, age2 = 15, 22 status = magnificent.is_dateable( age1, age2 ) print( age1, 'year-old can date a', age2, 'year-old is', status ) age1, age2 = 22, 15 status = magnificent.is_dateable( age1, age2 ) print( age1, 'year-old can date a', age2, 'year-old is', status ) age1, age2 = 19, 18 status = magnificent.is_dateable( age1, age2 ) print( age1, 'year-old can date a', age2, 'year-old is', status ) print( '\n-------------------------------------------------------\n' ) # testing mutually_dateable() age1, age2 = 25, 65 status = magnificent.mutually_dateable( age1, age2 ) print( age1, 'year-old can date a', age2, 'year-old and vice-versa is', status ) age1, age2 = 20, 18 status = magnificent.mutually_dateable( age1, age2 ) print( age1, 'year-old can date a', age2, 'year-old and vice-versa is', status ) print( '\n-------------------------------------------------------\n' ) # testing check_out() link1 = 'http://www.cs1112.org/datasets/csv/co1.csv' link2 = 'http://www.cs1112.org/datasets/csv/co2.csv' v1, sheet1 = 6, url.get_dataset( link1 ) v2, sheet2 = 4, url.get_dataset( link2 ) s1 = magnificent.check_out( sheet1, v1 ) s2 = magnificent.check_out( sheet2, v2 ) link1 = link1.replace( 'http://', '' ) link2 = link2.replace( 'http://', '' ) print( link1, 'distribution of', v1, 'is', s1 ) print( link2, 'distribution of', v2, 'is', s2 )