예제 #1
0
 def test_snake_case_to_camel_case(self):
     camel_case_str1 = utils.snake_case_to_camel_case('user_id_number')
     camel_case_str2 = utils.snake_case_to_camel_case('hello_world')
     camel_case_str3 = utils.snake_case_to_camel_case('test1')
     self.assertEqual(camel_case_str1, 'userIdNumber')
     self.assertEqual(camel_case_str2, 'helloWorld')
     self.assertEqual(camel_case_str3, 'test1')
예제 #2
0
def get_e2e_suite_names_from_jobs_travis_yml_file():
    """Extracts the test suites from env/jobs section from
    the .travis.yml file.

    Returns:
        list(str): An alphabetically-sorted list of names of test suites
        from the jobs section in the .travis.yml file.
    """
    travis_file_content = read_and_parse_travis_yml_file()
    jobs_str = python_utils.convert_to_bytes(
        travis_file_content['env']['jobs'])
    suites_from_jobs = []
    # The following line extracts the test suite name from the jobs section
    # that is in the form RUN_E2E_TESTS_ACCESSIBILITY=true.
    test_regex = re.compile(r'RUN_E2E_TESTS_([A-Z_]*)=')
    jobs = test_regex.findall(jobs_str)
    for job in jobs:
        suites_from_jobs.append(utils.snake_case_to_camel_case(job.lower()))

    return sorted(suites_from_jobs)