def test_species_count(): # manual assert_equals(3, hw2_manual.species_count(_pokemon_test)) assert_equals(0, hw2_manual.species_count(_empty)) # pandas assert_equals(3, hw2_pandas.species_count(_pokemon_test_df)) assert_equals(0, hw2_pandas.species_count(_empty_df))
def test_species_count(): ''' Test spcies_count funciton. ''' print("test_species_count") print('Part0') assert_equals(3, hw2_manual.species_count(parsed_data)) assert_equals(74, hw2_manual.species_count(parsed_data2)) print('Part1') assert_equals(3, hw2_pandas.species_count(DATA)) assert_equals(74, hw2_pandas.species_count(DATA2))
def test_species_count(): """ Test the function species_count """ print('Testing species_count') assert_equals(3, hw2_manual.species_count(data1)) assert_equals(3, hw2_pandas.species_count(data2)) assert_equals(82, hw2_manual.species_count(data3)) assert_equals(82, hw2_pandas.species_count(data4)) assert_equals(8, hw2_manual.species_count(data5)) assert_equals(8, hw2_pandas.species_count(data6))
def test_species_count(): """ Tests the function: species_count """ print('Testing species_count') # Cases from the made up "spec" for this problem assert_equals(3, hw2_manual.species_count(data1)) assert_equals(3, hw2_pandas.species_count(data2)) # Additional two cases assert_equals(7, hw2_manual.species_count(data3)) assert_equals(7, hw2_pandas.species_count(data4))
def test_manual_species_count(): ''' Tests the manual species_count functions ''' test_data = parse(POKEMON_TEST_FILE) my_data = parse(MY_POKEMON_FILE) print('Testing species_count') # Spec test assert_equals(3, hw2_manual.species_count(test_data)) # My test assert_equals(5, hw2_manual.species_count(my_data))
def test_species_count(): """ Tests the output of both versions of species_count() function. """ # Test Part 0 - Manual print('Test species_count from Part 0 - Manual') assert_equals(3, hw2_manual.species_count(data_m1)) assert_equals(82, hw2_manual.species_count(data_m2)) # Test Part 1 - Pandas print('Test species_count from Part 1 - Pandas') assert_equals(3, hw2_pandas.species_count(data_p1)) assert_equals(82, hw2_pandas.species_count(data_p2))
def part0(): """ Calculates various statistics about the Pokemon dataset using the implementation in Part 0. """ print('=== Starting Part 0 ===') data = cse163_utils.parse(DATA) print('Number of species:', hw2_manual.species_count(data)) print('Highest level pokemon:', hw2_manual.max_level(data)) print('Low-level Pokemon', hw2_manual.filter_range(data, 1, 9)) print('Average attack for fire types', hw2_manual.mean_attack_for_type(data, 'fire')) print('Count of each Pokemon type:') print(hw2_manual.count_types(data)) print('Highest stage for each Pokemon type') print(hw2_manual.highest_stage_per_type(data)) print('Average attack for each Pokemon type') print(hw2_manual.mean_attack_per_type(data))