def test_jsonbody(self): payload = {'section': 'webui', 'option': 'port'} headers = {'content-type': 'application/json'} ret = requests.get(webaddress + "/getConfigValue", headers=headers, auth=HTTPBasicAuth(*credentials), data=json.dumps(payload)) assertEqual(ret.status_code, 200) assert ret.text
def test_httpauth(self): # cheap http auth ret = requests.get(webaddress + "/getServerVersion", auth=HTTPBasicAuth(*credentials)) assertEqual(ret.status_code, 200) assert ret.text
def test_make_negative_zero(): assertEqual(return_negative.make_negative(0),0)
def test_make_negative_small_negative(): assertEqual(return_negative.make_negative(-9),-9)
def test_make_negative_large_negative(): assertEqual(return_negative.make_negative(42),-42)
def test_httpauth(self): # cheap http auth ret = requests.get(webaddress + '/getServerVersion', auth=HTTPBasicAuth(*credentials)) assertEqual(ret.status_code, 200) assert ret.text
def assertion(a=None, b=None, c=None, d=None, **_): if ctx.type == context.NODE_INSTANCE: assertEqual(a, 'a_value') assertEqual(b, 'b_value') assertEqual(c, None) assertEqual(d, None) else: assertEqual(a, None) assertEqual(b, None) assertEqual(c, 'c_value') assertEqual(d, 'd_value') with update_storage(ctx) as data: invocations = data.get('invocations', []) data['invocations'] = invocations invocations.append(ctx.type)