Source

xnet-hacks / tests / test_tool.py

Full commit
import sys
import py
import json
from xnet.xjob import XJobSpec, XResult
from xnet.helpers import json_encode
from xnet import tool
from mocksupport import MockConnPost, MockConnGet
        
def test_submitxjob():
    xjobspec = XJobSpec(args="123".split())
    mockconn = MockConnPost("/", json.dumps({'xjobid': 1}))
    xjobid = tool.submitxjob(mockconn, xjobspec)
    assert xjobid == 1