def test_index_json(alice): """ we can download the index file as json """ data = util.web_get(alice, u"", params={u"t": u"json"}) # it should be valid json json.loads(data)
def test_upload_download(alice): """ upload a file, then download it via readcap """ FILE_CONTENTS = u"some contents" readcap = util.web_post( alice, u"uri", data={ u"t": u"upload", u"format": u"mdmf", }, files={ u"file": FILE_CONTENTS, }, ) readcap = readcap.strip() data = util.web_get(alice, u"uri", params={ u"uri": readcap, u"filename": u"boom", }) assert data == FILE_CONTENTS
def thread_function(ThreadName): global ReqCounter for i in range(1, MaxI): ReqCounter[ThreadName] += 1 TimeStart = time.time() Result = util.web_get(f"{HostPort}/seek?words=looks,like,bird", Verbose=False) #print(Result) TimeDelta = time.time() - TimeStart ReqTempo = int(1.0 / TimeDelta) Info = f"{i} {ThreadName} len: {len(Result)}, Tempo {ReqTempo}, req/sec\n" util.file_write(dict(), Fname="test_performance.txt", Content=Info, Mode="a", LogCreate=False) print(Info) time.sleep(5)
def test_index(alice): """ we can download the index file """ util.web_get(alice, u"")