モジュールレベル関数のテスト
| 494 | np.testing.assert_array_equal(image, original) |
| 495 | |
| 496 | class TestModuleLevelFunctions: |
| 497 | """モジュールレベル関数のテスト""" |
| 498 | |
| 499 | def test_list_palette_names_returns_tuple(self): |
| 500 | """list_palette_names() がタプルを返すこと""" |
| 501 | result = list_palette_names() |
| 502 | assert isinstance(result, tuple) |
| 503 | assert "pyxel" in result |
| 504 | |
| 505 | def test_list_palette_names_matches_class_method(self): |
| 506 | """list_palette_names() が Convert.list_color_palettes() と同じ結果を返すこと""" |
| 507 | assert list_palette_names() == Convert.list_color_palettes() |
| 508 | |
| 509 | def test_load_palette_rows_with_suffix(self): |
| 510 | """load_palette_rows() が .csv 付きで動作すること""" |
| 511 | result = load_palette_rows("pyxel.csv") |
| 512 | assert isinstance(result, list) |
| 513 | assert len(result) == 16 |
| 514 | |
| 515 | def test_load_palette_rows_without_suffix(self): |
| 516 | """load_palette_rows() が .csv なしで動作すること""" |
| 517 | result = load_palette_rows("pyxel") |
| 518 | assert isinstance(result, list) |
| 519 | assert len(result) == 16 |
| 520 | |
| 521 | def test_load_palette_rows_rgb_values(self): |
| 522 | """load_palette_rows() が正しい RGB 値を返すこと""" |
| 523 | result = load_palette_rows("pyxel") |
| 524 | for row in result: |
| 525 | assert len(row) == 3 |
| 526 | assert all(0 <= v <= 255 for v in row) |
nothing calls this directly
no outgoing calls
no test coverage detected