예제 #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)
예제 #2
0
파일: http.py 프로젝트: BruceBushby/procfs
    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)
예제 #3
0
파일: cli_test.py 프로젝트: progrium/procfs
def test_proc_cannotlist(proc):
    with pytest.raises(AttributeError):
        assert cli.find('cpuinfo/0/cpu_family', True)
예제 #4
0
파일: cli_test.py 프로젝트: progrium/procfs
def test_proc_badfile(proc):
    with pytest.raises(PathNotFoundError):
        assert cli.find('jbsdabfjasdbfsdafl', False)
예제 #5
0
파일: cli_test.py 프로젝트: progrium/procfs
def test_proc_itemorattr(proc):
    assert cli.find('loadavg/average/15', False)
예제 #6
0
파일: cli_test.py 프로젝트: progrium/procfs
def test_proc_processes(proc):
    assert cli.find('1', False)
예제 #7
0
파일: cli_test.py 프로젝트: progrium/procfs
def test_proc_timedata(proc):
    assert cli.find('1/stat', False)
예제 #8
0
def test_proc_cannotlist(proc):
    with pytest.raises(AttributeError):
        assert cli.find('cpuinfo/0/cpu_family', True)
예제 #9
0
def test_proc_badfile(proc):
    with pytest.raises(PathNotFoundError):
        assert cli.find('jbsdabfjasdbfsdafl', False)
예제 #10
0
def test_proc_itemorattr(proc):
    assert cli.find('loadavg/average/15', False)
예제 #11
0
def test_proc_processes(proc):
    assert cli.find('1', False)
예제 #12
0
def test_proc_timedata(proc):
    assert cli.find('1/stat', False)