🔒 run_student import bekçisi — ImportError sınıfı CI'da compileall'ın kör noktasıydı
Browse files at this commit15f12444bdfd056446884f3569e652b7bc48ad6fParent: a023743- test
- 🔒 run_student import bekçisi — ImportError sınıfı CI'da compileall'ın kör noktasıydı
1 changed file +21 -0
tests/unit/test_demo_import.pyadded+21 -0
| @@ -0,0 +1,21 @@ | |||
| 1 | +"""Modül YÜZEYİ: kiracılık temizliğinden sonra demo koşumu import edilebilmeli. | ||
| 2 | + | ||
| 3 | +Ölçülen hata (2026-09-17, b2ba173 sonrası doğrulamada): `src/demo/run_student.py` | ||
| 4 | +kaldırılmış `PUBLIC_SCHOOL` sabitini import ediyordu → **ImportError**. CI'daki | ||
| 5 | +`python -m compileall` bunu GÖRMEZ (derleme geçer, import patlar); yalnız | ||
| 6 | +gerçek import yakalar. `src/` içinde hiçbir test bu modülü import etmediği için | ||
| 7 | +kusur yeşil süitten geçmişti — bu test o boşluğu kapatır. | ||
| 8 | +""" | ||
| 9 | +import unittest | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +class DemoImportTests(unittest.TestCase): | ||
| 13 | + def test_run_student_module_imports(self): | ||
| 14 | + import src.demo.run_student as m | ||
| 15 | + # Okul ZORUNLUDUR ve paylaşılan/"public" bir boyut yoktur; demo kendi | ||
| 16 | + # okulunu kurar (bkz. guard/tenant.py + demo/school.py). | ||
| 17 | + self.assertEqual(m.DEMO_OKUL, "demo") | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +if __name__ == "__main__": | ||
| 21 | + unittest.main() | ||