diff --git a/resources/tester/test_m02_hopyo_excel.py b/resources/tester/test_m02_hopyo_excel.py index 3d84889a9..e2a59a820 100644 --- a/resources/tester/test_m02_hopyo_excel.py +++ b/resources/tester/test_m02_hopyo_excel.py @@ -191,32 +191,32 @@ def test_엉터리_시트없음_큰_파일_400(client, monkeypatch): @pytest.mark.parametrize( - ("role", "layer", "owner", "want"), + ("role", "layer", "owner"), [ - ({"role": "SYSTEM_ADMIN"}, "system", None, 200), - ({"role": "USER"}, "system", None, 403), - ({"role": "ADMIN"}, "company", None, 200), - ({"role": "USER"}, "company", None, 403), - ({"role": "USER"}, "personal", None, 200), - ({"role": "USER"}, "personal", "7/43", 403), - ({"role": "USER"}, "personal", "8/50", 403), + ({"role": "SYSTEM_ADMIN"}, "system", None), + ({"role": "USER"}, "system", None), + ({"role": "ADMIN"}, "company", None), + ({"role": "USER"}, "company", None), + ({"role": "USER"}, "personal", None), + ({"role": "USER"}, "personal", "7/43"), + ({"role": "USER"}, "personal", "8/50"), ], ) -def test_역할_표(client, role, layer, owner, want): +def test_역할_표_늘_개인_층(client, role, layer, owner): + """837-1 · 요구 855 — 누가 어느 경로 층 · 주인으로 올려도 자기 개인 층(옛 「층 권한 403」 갈음).""" client.who.update(role) params = {"owner": owner} if owner else {} - assert _post(client, layer, **params).status_code == want - if want == 200: - assert client.get(URL.format(layer)).json()["줄"][0]["호표수"] == 68 + assert _post(client, layer, **params).status_code == 200 + assert client.get(URL.format("personal")).json()["줄"][0]["호표수"] == 68 + assert client.get(URL.format(layer), params=params).json()["줄"][0]["호표수"] == 68 # 같은 자리 -def test_마스터_층은_마스터_폴더(client): +def test_마스터_경로로_올려도_마스터_폴더에_안_씀(client): client.who.update(role="SYSTEM_ADMIN") + before = master_hash() assert _post(client, "system").status_code == 200 - assert (client.system / hs.DIRNAME / "HP-000001.json").is_file() - client.who.update(role="USER") - assert client.get(URL.format("system")).json()["줄"][0]["키"] == "HP-000001" # 읽기 = 누구나 - assert client.delete(URL.format("system") + "/HP-000001").status_code == 403 + assert not (client.system / hs.DIRNAME).exists() # 837-1 — 마스터 폴더 증가 0 + assert master_hash() == before def _linked_xlsx() -> bytes: diff --git a/resources/tester/test_m02_hopyo_grid.py b/resources/tester/test_m02_hopyo_grid.py index 59aba9f0d..1e1e4ee04 100644 --- a/resources/tester/test_m02_hopyo_grid.py +++ b/resources/tester/test_m02_hopyo_grid.py @@ -100,7 +100,7 @@ def test_올리기_격자_200_404_지우기(client): ("role", "layer", "owner", "want"), [ ({"role": "USER"}, "personal", None, 200), - ({"role": "USER"}, "personal", "7/43", 403), + ({"role": "USER"}, "personal", "7/43", 200), # 837-1 — 주인 글 무시 · 늘 자기 개인 층 ({"role": "USER"}, "company", None, 200), ({"role": "USER"}, "system", None, 200), ], diff --git a/resources/tester/test_m02_hopyo_screen.py b/resources/tester/test_m02_hopyo_screen.py index 36d536b5b..eed03d6c1 100644 --- a/resources/tester/test_m02_hopyo_screen.py +++ b/resources/tester/test_m02_hopyo_screen.py @@ -39,9 +39,8 @@ def test_좌측_판_자리와_권한(): assert "input.hidden = true;" in hopyo_side choose = hopyo_side.split("async function choose()")[1].split("input.addEventListener")[0] assert "input.click();" in choose # 누름 하나 — 바로 파일 고르기 창 - assert "accessFor(layer, null, user).canWrite" in imp # 결과 층 = 쓸 수 있는 층만 - assert 'let pick: ManageLayer = "personal";' in hopyo_side # 기본 개인 - assert "layers.length > 1" in hopyo_side # 층 고름 = 둘 이상일 때만(일반 = 개인 하나) + assert "writableLayers" not in imp + hopyo_side # 837-1 층 고름 걷음 — 늘 개인 층 + assert "uploadHopyo(MINE, file)" in hopyo_side for gone in ("wantSangeun", "STEPS", "second(", "steps.set", "data-hopyo-sangeun"): assert gone not in imp + hopyo_side, gone # 중간 걸음 · 단가산출 체크 없음