예제 #1
0
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")
예제 #2
0
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"
예제 #3
0
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")
예제 #4
0
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"
예제 #5
0
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"
예제 #6
0
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"
예제 #7
0
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"
예제 #8
0
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")