CatalogClient.courseExists(term, code) with mocked HTTP
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 78/100
Direzione di ricerca
Read the generated SDK entry point at packages/sdk_dart/lib/src/generated/catalog.dart and the app configuration in lib/config.dart, then implement the wrapper in lib/onboarding/course_lookup.dart. Add MockClient coverage in test/course_lookup_test.dart for the listed responses and query parameters; done means those tests pass without network access and errors map to unavailable.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What to build
The app needs to ask the catalog whether a typed course exists in a term. Do not write HTTP or JSON parsing: the SDK already ships the generated client. package:devdogsuga_sdk/catalog.dart exports CatalogClient(baseUrl:, httpClient:, clientName:) with courseExists({required String abbr, TermCode? term}), returning CourseExists (exists, offered, abbr, term). Source: packages/sdk_dart/lib/src/generated/catalog.dart in DevDogsUGA/DevDogsUGA.
Build a thin app-side wrapper and test it:
class CourseLookuptaking aCatalogClient, withFuture<CourseCheck> check(int term, String code)whereCourseCheckisexists,offered, orunavailable(the catalog is down or the request throwsApiException, which is the documented fallback: the database then checks only the format).- A provider (in
lib/app.dartor a new file) that builds oneCatalogClientfrom theCATALOG_URLdefine (.env.examplealready has it) withclientName: 'dogpack'.
Files
- new
lib/onboarding/course_lookup.dart lib/config.dart(readCATALOG_URL; fall back to the SDK'scatalogServers['production'])- new
test/course_lookup_test.dart pubspec.yamlandpubspec.lock: addhttpas a dev dependency (flutter pub add --dev http), becausepackage:http/testing.dartis not otherwise a direct dependency andflutter analyzefails without it
Acceptance
- Tests use
package:http/testing.dartMockClientpassed ashttpClient; no network. - The test asserts the request path ends with
/course-exists(the real base URL is.../catalog/v1, so the full path is/catalog/v1/course-exists) and thatabbrandtermare query parameters. - Covered: exists and offered; exists but not offered; unknown course; a 500 gives
unavailable; a socket failure givesunavailable. - No handwritten JSON decoding in DogPack code.
How to check
flutter test test/course_lookup_test.dart.
Before you start
Setup is in first contribution. Run flutter analyze and flutter test before you open the PR; both must pass. Keep the change to the files listed. Comment on this issue to claim it.
- Lingua principale
- PLpgSQL
- Stelle
- 0
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di DevDogsUGA/DogPack
-
discover
Difficoltà 2/5 1-3 ore Idoneità per principianti 91/100
DevDogsUGA/DogPack#14 ·
-
onboarding
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
DevDogsUGA/DogPack#10 ·
-
good first issue onboarding
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
DevDogsUGA/DogPack#8 ·
-
good first issue onboarding
Difficoltà 2/5 1-3 ore Idoneità per principianti 91/100
DevDogsUGA/DogPack#7 ·
-
good first issue polish
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
DevDogsUGA/DogPack#4 ·
Tutte le issue di DevDogsUGA/DogPack
Issue simili
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] 增量 SSE 解析器未识别单独 CR 换行,导致事件无法及时交付Forse già presa @king-wwwhhh l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
langchain4j/langchain4j#6669 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/playwright#43327 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
pesu-dev/discord_bot#97 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/TypeScript#64758 ·
I maintainer di solito rispondono entro 1 giorno