コード例 #1
0
 def test_output_zeroes(self) -> None:
     quota = _Quota(total_gpu_run_time_minutes=0,
                    total_non_gpu_run_time_minutes=0)
     out = QuotaFormatter()(quota)
     assert out == "\n".join([
         f"{bold_start}GPU:{bold_end} 0m", f"{bold_start}CPU:{bold_end} 0m"
     ])
コード例 #2
0
 def test_output_only_cpu(self) -> None:
     quota = _Quota(total_non_gpu_run_time_minutes=3256,
                    total_gpu_run_time_minutes=None)
     out = QuotaFormatter()(quota)
     assert out == "\n".join([
         f"{bold_start}GPU:{bold_end} infinity",
         f"{bold_start}CPU:{bold_end} 3256m",
     ])
コード例 #3
0
 def test_output(self) -> None:
     quota = _Quota(
         total_gpu_run_time_minutes=321,
         total_non_gpu_run_time_minutes=123,
     )
     out = QuotaFormatter()(quota)
     assert out == "\n".join(
         [f"{bold_start}GPU:{bold_end} 321m", f"{bold_start}CPU:{bold_end} 123m"]
     )