File: test_DumpEntries.py

package info (click to toggle)
weakforced 3.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,196 kB
  • sloc: cpp: 20,397; python: 2,002; sh: 700; makefile: 432
file content (25 lines) | stat: -rw-r--r-- 765 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import requests
import socket
import time
import json
import os
from subprocess import call
from test_helper import ApiTestCase

class TestDumpEntries(ApiTestCase):

    def test_dumpentries(self):
        for i in range(100):
            r = self.reportFunc('dumpentries', '199.99.99.99', "1234'%s" % i, False)

        dumpfile = "/tmp/wfdb.txt"
        result = call(["../wforce/wf_dump_entries", "-f", dumpfile, "-u", "http://127.0.0.1:8084", "-l", "127.0.0.1", "-p", "9999", "-w", os.environ.get('APIKEY', 'super')])
        if result:
            f = open(dumpfile, "r")
            found = False
            for x in f:
                if x.find("199.99.99.99"):
                    found = True
                    break

            self.assertTrue(found)