Strengthen logging assertions for refused REST activations

オープン 初心者向け
#239 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
testing

調査の方向性

netbox_scripts/tests/api/test_projects.pyを開き、test_a_refused_activation_returns_a_fixed_message_and_logs_its_reasonを拡張します。既存のassertLogs()によるチェックを読み、捕捉されたレコードのレベルがWARNINGであり、例外情報がないことを確認します。このテストを実行します。メッセージのチェックを維持し、ログレベルまたは例外情報が誤っている場合にも失敗すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

app: scripts status: backlog type: housekeeping
Proposed Changes

Extend test_a_refused_activation_returns_a_fixed_message_and_logs_its_reason in netbox_scripts/tests/api/test_projects.py to assert that the captured log record has a WARNING level and contains no exception information, in addition to the existing message assertions.

Justification

Expected activation refusals are logged at WARNING without a traceback. However, assertLogs() also captures records at higher severity levels, so changing the logging call to logger.exception() would not cause the existing tests to fail.

Explicitly checking the log level and the absence of exception information ensures that this intended behavior remains covered by the tests.

主要言語
Python
スター
8
フォーク
0
平均マージ
12時間 46分
マージ済み PR(30日)
83

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

netbox-community/netbox-scripts のほかの issue

netbox-community/netbox-scripts の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。