def test_run_command(): result = todo.run_command("test", {"abcd": "efgh", "hijk": "hlmk"}) expected = """Command 'test' returns: abcd:efgh hijk:hlmk""" assert result == expected, result + "!=" + expected print("Ok-run_command")
def test_run_command(): result = todo.run_command('test', {'abcd': 'efgh', 'ijkl': 'mnop'}) expected = """Command 'test' returned: abcd: efgh ijkl: mnop""" assert result == expected, result + " != " + expected print "ok - run_command"
def test_run_command(): result = todo.run_command("test", {"abcd": "efgh", "hijk": "hlmk"}) expected = """Command 'test' returns: abcd:efgh hijk:hlmk""" assert result == expected, result +"!=" + expected print("Ok-run_command")
def test_run_command(): result = todo.run_command('test', {'abcd': 'edfg', 'ijkl': 'mnlo'}) expected = """Command 'test' returned: abcd: edfg ijkl: mnlo """ print result assert result == expected, \ result + " != " + expected print "ok - run command"
def test_run_command(): result = todo.run_command( 'test', {'abcd': 'efgh', 'ijkl': 'mnop'} ) expected = """Command 'test' returned: abcd: efgh ijkl: mnop""" assert result == expected, result + " != " + expected print "ok - run_command"
def test_run_command(): result = todo.run_command( 'test', {'abcd': 'edfg', 'ijkl': 'mnlo'} ) expected = """Command 'test' returned: abcd: edfg ijkl: mnlo """ print result assert result == expected, \ result + " != " + expected print "ok - run command"
def test_run_command(): # Create "test" command result = todo.run_command( 'test', {'abcd': 'efgh', 'ijkl': 'mnop'} # Design by wishful thinking ) expected = """Command 'test' returned: abcd: efgh ijkl: mnop""" assert result == expected, \ result + " != " + expected print "OK - run_commnad"
def handle_request(uri, method): value = clean_uri(uri) # list comprehension, you dumbass commands = { 'GET': ['show',{'which':value}], 'DELETE':['delete',{'which':value}], 'POST':[], 'PUT':[], } result = todo.run_command(commands[method][0],commands[method][1]) output = sock.send(str(result) + "\n")