Clean up querystring logic.

This commit is contained in:
Steve Pulec 2013-12-28 20:15:37 -05:00
commit 8b278eb05d
14 changed files with 66 additions and 35 deletions

View file

@ -13,13 +13,17 @@ def test_wrong_arguments():
pass
@patch('moto.server.app.run')
def test_right_arguments(app_run):
@patch('moto.server.run_simple')
def test_right_arguments(run_simple):
main(["s3"])
app_run.assert_called_once_with(host='0.0.0.0', port=5000)
func_call = run_simple.call_args[0]
func_call[0].should.equal("0.0.0.0")
func_call[1].should.equal(5000)
@patch('moto.server.app.run')
def test_port_argument(app_run):
@patch('moto.server.run_simple')
def test_port_argument(run_simple):
main(["s3", "--port", "8080"])
app_run.assert_called_once_with(host='0.0.0.0', port=8080)
func_call = run_simple.call_args[0]
func_call[0].should.equal("0.0.0.0")
func_call[1].should.equal(8080)