Exemple #1
0
    def do_GET(self):
        path = self.path[1:]

        try:
            response = cli.find(path, False)
            self.send_response(200)
            self.send_header("Content-Type", "application/json")
            self.end_headers()
            self.wfile.write(response)
        except PathNotFoundError as e:
            self.send_error(404, "path %s does not exist" % e)
Exemple #2
0
    def do_GET(self):
        path = self.path[1:]

        try:
            response = cli.find(path, False)
            self.send_response(200)
            self.send_header("Content-Type", "application/json")
            self.end_headers()
            self.wfile.write(response)
        except PathNotFoundError as e:
            self.send_error(404, "path %s does not exist" % e)
Exemple #3
0
def test_proc_cannotlist(proc):
    with pytest.raises(AttributeError):
        assert cli.find('cpuinfo/0/cpu_family', True)
Exemple #4
0
def test_proc_badfile(proc):
    with pytest.raises(PathNotFoundError):
        assert cli.find('jbsdabfjasdbfsdafl', False)
Exemple #5
0
def test_proc_itemorattr(proc):
    assert cli.find('loadavg/average/15', False)
Exemple #6
0
def test_proc_processes(proc):
    assert cli.find('1', False)
Exemple #7
0
def test_proc_timedata(proc):
    assert cli.find('1/stat', False)
Exemple #8
0
def test_proc_cannotlist(proc):
    with pytest.raises(AttributeError):
        assert cli.find('cpuinfo/0/cpu_family', True)
Exemple #9
0
def test_proc_badfile(proc):
    with pytest.raises(PathNotFoundError):
        assert cli.find('jbsdabfjasdbfsdafl', False)
Exemple #10
0
def test_proc_itemorattr(proc):
    assert cli.find('loadavg/average/15', False)
Exemple #11
0
def test_proc_processes(proc):
    assert cli.find('1', False)
Exemple #12
0
def test_proc_timedata(proc):
    assert cli.find('1/stat', False)