예제 #1
0
def test_wrong_arguments():
    try:
        main(["name", "test1", "test2", "test3"])
        assert False, ("main() when called with the incorrect number of args"
                       " should raise a system exit")
    except SystemExit:
        pass
예제 #2
0
파일: test_server.py 프로젝트: flozano/moto
def test_wrong_arguments():
    try:
        main(["name", "test1", "test2", "test3"])
        assert False, ("main() when called with the incorrect number of args"
                       " should raise a system exit")
    except SystemExit:
        pass
예제 #3
0
    def setUp(self):
        import threading
        from moto.server import main

        t = threading.Thread(name="moto_thread", target=lambda: main([]))
        t.daemon = True
        # UI lives at http://localhost:5000/moto-api
        t.start()
예제 #4
0
파일: test_server.py 프로젝트: flozano/moto
def test_port_argument(app_run):
    main(["name", "s3", 8080])
    app_run.assert_called_once_with(port=8080)
예제 #5
0
파일: test_server.py 프로젝트: flozano/moto
def test_right_arguments(app_run):
    main(["name", "s3"])
    app_run.assert_called_once_with(port=None)
예제 #6
0
def test_port_argument(run_simple):
    main(["s3", "--port", "8080"])
    func_call = run_simple.call_args[0]
    func_call[0].should.equal("127.0.0.1")
    func_call[1].should.equal(8080)
예제 #7
0
def test_right_arguments(run_simple):
    main(["s3"])
    func_call = run_simple.call_args[0]
    func_call[0].should.equal("127.0.0.1")
    func_call[1].should.equal(5000)
예제 #8
0
def test_port_argument(run_simple):
    main(["s3", "--port", "8080"])
    func_call = run_simple.call_args[0]
    func_call[0].should.equal("127.0.0.1")
    func_call[1].should.equal(8080)
예제 #9
0
def test_right_arguments(run_simple):
    main(["s3"])
    func_call = run_simple.call_args[0]
    func_call[0].should.equal("127.0.0.1")
    func_call[1].should.equal(5000)
예제 #10
0
import sys
import argparse
import moto.server as server

# Replace moto emr with the custom emr implementation
sys.modules['moto.emr.urls'] = __import__('localemr.urls')

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Local AWS EMR - A local service that imitates AWS EMR ")
    parser.add_argument('-p',
                        '--port',
                        help='Port to run the service on',
                        type=int,
                        default=3000)
    parser.add_argument("-H",
                        "--host",
                        type=str,
                        help="Which host to bind",
                        default="0.0.0.0")
    args = parser.parse_args()
    server.main(['emr', '-H', args.host, '--port', str(args.port)])
예제 #11
0
def test_port_argument(app_run):
    main(["s3", "--port", "8080"])
    app_run.assert_called_once_with(host='0.0.0.0', port=8080)
예제 #12
0
def test_right_arguments(app_run):
    main(["s3"])
    app_run.assert_called_once_with(host='0.0.0.0', port=5000)
예제 #13
0
파일: main.py 프로젝트: davlum/ros3
import moto.server as server
import sys

# Replace moto s3 with the custom s3 implementation
sys.modules['moto.s3.urls'] = __import__('ros3.urls')

if __name__ == "__main__":
    server.main(['s3', *sys.argv[1:]])
예제 #14
0
 def thread_func(params):
     return moto_server.main(
         [api, '-p', str(port), '-H', constants.BIND_HOST])
예제 #15
0
 def thread_func(params):
     if localstack_config.FORWARD_EDGE_INMEM:
         return moto_server.main(
             ["-p", str(port), "-H", constants.BIND_HOST])
     return moto_server.main(
         [api, "-p", str(port), "-H", constants.BIND_HOST])