def METHOD_NAME(g, fs):
    d1 = fs.create_dir("/foobar/foo")
    d2 = fs.create_dir("/foobar/bar")
    d3 = fs.create_dir("/foobar/foo/foo")
    d4 = fs.create_dir("/foobar/foo/bar")
    session = {
        "schema_version": 1,
        "timestamp": 1556092197,
        "workspace": {
            "0": [
                [
                    {"directory": d1.path, "label": "1", "custom_label_set": True},
                    {"directory": d2.path, "label": "2", "custom_label_set": True},
                    {"directory": d3.path, "label": d3.path, "custom_label_set": False},
                ]
            ],
            "1": [[{"directory": d4.path, "label": "4", "custom_label_set": True}]],
        },
    }
    fn = fs.create_file("/foobar/session.json")
    with open(fn.path, "w", encoding="utf-8") as f:
        f.write(json.dumps(session))
    g.restore_tabs(fn.name)
    nb = g.notebook_manager.get_notebook(0)
    assert nb.get_n_pages() == 3
    assert nb.get_tab_text_index(0) == "1"
    assert nb.get_tab_text_index(1) == "2"
    nb = g.notebook_manager.get_notebook(1)
    assert nb.get_n_pages() == 1
    assert nb.get_tab_text_index(0) == "4"