'Verify get_programs_with_type returns the expected list of programs.'

@mock.patch((UTILS_MODULE + '.get_programs'))
@mock.patch((UTILS_MODULE + '.get_program_types'))
def test_get_programs_with_type(self, mock_get_program_types, mock_get_programs):

    programs_with_program_type = []
    programs = ProgramFactory.create_batch(2)
    program_types = []
    for program in programs:
        program_type = ProgramTypeFactory(name=program['type'])
        program_types.append(program_type)
        program_with_type = copy.deepcopy(program)
        program_with_type['type'] = program_type
        programs_with_program_type.append(program_with_type)
    mock_get_programs.return_value = programs
    mock_get_program_types.return_value = program_types
    actual = get_programs_with_type(self.site)
    self.assertEqual(actual, programs_with_program_type)
