Esempio n. 1
0
 def test_cli_utility(self):
     zappa_cli = ZappaCLI()
     zappa_cli.api_stage = 'ttt888'
     zappa_cli.load_settings('test_settings.json')
     zappa_cli.create_package()
     zappa_cli.remove_local_zip()
     logs = [
         {
             'timestamp': '12345',
             'message': '[START RequestId] test'
         },
         {
             'timestamp': '12345',
             'message': '[REPORT RequestId] test'
         },
         {
             'timestamp': '12345',
             'message': '[END RequestId] test'
         },
         {
             'timestamp': '12345',
             'message': 'test'
         }
     ]
     zappa_cli.print_logs(logs)
     zappa_cli.check_for_update()
Esempio n. 2
0
 def test_cli_utility(self):
     zappa_cli = ZappaCLI()
     zappa_cli.api_stage = 'ttt888'
     zappa_cli.load_settings('test_settings.json')
     zappa_cli.create_package()
     zappa_cli.remove_local_zip()
     logs = [
         {
             'timestamp': '12345',
             'message': '[START RequestId] test'
         },
         {
             'timestamp': '12345',
             'message': '[REPORT RequestId] test'
         },
         {
             'timestamp': '12345',
             'message': '[END RequestId] test'
         },
         {
             'timestamp': '12345',
             'message': 'test'
         },
         {
             'timestamp': '1480001341214',
             'message': '[INFO] 2016-11-24T15:29:13.326Z c0cb52d1-b25a-11e6-9b73-f940ce24319a 59.111.125.48 - -  [24/Nov/2016:15:29:13 +0000] "GET / HTTP/1.1" 200 2590 "" "python-requests/2.11.0" 0/4.672'
         },
         {
             'timestamp': '1480001341214',
             'message': '[INFO] 2016-11-24T15:29:13.326Z c0cb52d1-b25a-11e6-9b73-f940ce24319a 59.111.125.48 - -  [24/Nov/2016:15:29:13 +0000] "GET / HTTP/1.1" 400 2590 "" "python-requests/2.11.0" 0/4.672'
         },
         {
             'timestamp': '1480001341215',
             'message': '[1480001341258] [DEBUG] 2016-11-24T15:29:01.258Z b890d8f6-b25a-11e6-b6bc-718f7ec807df Zappa Event: {}'
         }
     ]
     zappa_cli.print_logs(logs)
     zappa_cli.print_logs(logs, colorize=False)
     zappa_cli.print_logs(logs, colorize=False, http=True)
     zappa_cli.print_logs(logs, colorize=True, http=True)
     zappa_cli.print_logs(logs, colorize=True, http=False)
     zappa_cli.check_for_update()