示例#1
0
def test_max_level():
    # manual
    assert_equals(('Lapras', 72), hw2_manual.max_level(_pokemon_test))
    assert_equals(('Persian', 40), hw2_manual.max_level(_single))
    # pandas
    assert_equals(('Lapras', 72), hw2_pandas.max_level(_pokemon_test_df))
    assert_equals(('Persian', 40), hw2_pandas.max_level(_single_df))
示例#2
0
def test_max_level():
    '''
    Test max_level funciton.
    '''
    print("test_max_level")
    print('Part0')
    assert_equals(('Lapras', 72), hw2_manual.max_level(parsed_data))
    assert_equals(('Victreebel', 100), hw2_manual.max_level(parsed_data2))
    print('Part1')
    assert_equals(('Lapras', 72), hw2_pandas.max_level(DATA))
    assert_equals(('Victreebel', 100), hw2_pandas.max_level(DATA2))
示例#3
0
def test_max_level():
    """
    Test the function max_level
    """
    print('Testing max_level')

    assert_equals(('Lapras', 72), hw2_manual.max_level(data1))
    assert_equals(('Lapras', 72), hw2_pandas.max_level(data2))
    assert_equals(('Victreebel', 100), hw2_manual.max_level(data3))
    assert_equals(('Victreebel', 100), hw2_pandas.max_level(data4))
    assert_equals(('Magmar', 96), hw2_manual.max_level(data5))
    assert_equals(('Magmar', 96), hw2_pandas.max_level(data6))
示例#4
0
def test_max_level():
    """
    Tests the function: max_level
    """
    print('Testing max_level')

    # Cases from the made up "spec" for this problem
    assert_equals(('Lapras', 72), hw2_manual.max_level(data1))
    assert_equals(('Lapras', 72), hw2_pandas.max_level(data2))
    # Additional two cases
    assert_equals(('Lapras', 72), hw2_manual.max_level(data3))
    assert_equals(('Lapras', 72), hw2_pandas.max_level(data4))
示例#5
0
def test_manual_max_level():
    '''
    Test the manual max_level function
    '''

    test_data = parse(POKEMON_TEST_FILE)
    box_data = parse(POKEMON_BOX_FILE)
    print('Testing max_level')

    # Spec test
    assert_equals(('Lapras', 72), hw2_manual.max_level(test_data))

    # My test
    assert_equals(('Victreebel', 100), hw2_manual.max_level(box_data))
def test_max_level():
    """
    Tests the output of both versions of max_level() function.
    """

    # Test Part 0 - Manual
    print('Test max_level from Part 0 - Manual')

    assert_equals(('Lapras', 72), hw2_manual.max_level(data_m1))
    assert_equals(('Victreebel', 100), hw2_manual.max_level(data_m2))

    # Test Part 1 - Pandas
    print('Test max_level from Part 1 - Pandas')

    assert_equals(('Lapras', 72), hw2_pandas.max_level(data_p1))
    assert_equals(('Victreebel', 100), hw2_pandas.max_level(data_p2))
示例#7
0
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))