Exemplo n.º 1
0
def test_create_lambda_with_timer_trigger():
    output_str = os.run_command(
        'cd lambda_with_timer_trigger; rm -rf vendor/; git clone https://github.com/zach-oliver/pymadeeasy.git vendor/; chalice deploy',
        bool_output=True)
    output_str = 'lambda_with_timer_trigger/' + output_str
    output_str = os.read_file(output_str, bool_no_lines=True)
    output_str = os.find_url_in_string(output_str)
    return output_str
Exemplo n.º 2
0
def test_operating_system_functions():
    p.print_message_highlighted('TESTING OPERATING_SYSTEM_FUNCTIONS.PY')
    p.print_str("This should be the exact time now as a string: %s" %
                os.get_current_date_time(as_string=True))
    os.run_command('ls -la')
    p.print_str(
        "Above should be the list of files in the current directory: run_command test"
    )
    p.print_str(os.convert_string_to_url("I can't get no satisfaction!"))
    p.print_str(
        "Above should be: I-cant-get-no-satisfaction: convert_string_to_url test"
    )
    test_string = "This is my tweet http://example.com/blah check it out"
    p.print_str(test_string)
    p.print_str(os.find_url_in_string(test_string))
    p.print_str("Above should be the URL in the statement above it")
    p.print_str("The current working directory is %s" %
                os.get_current_working_directory())
    p.print_str(
        "It correctly returned a string: %s" %
        str(os.check_variable_type(os.get_current_working_directory(), str)))
Exemplo n.º 3
0
def test_delete_lambda_with_api_trigger():
    os.run_command('cd lambda_with_api_trigger; chalice delete --stage dev',
                   bool_output=True)