예제 #1
0
 def test_output_includes_runtime(self):
     main(["euler", "p1"], self.output)
     self.assertRegexpMatches(self.output.getvalue(), "\(\d+\.\d{3} secs\)")
예제 #2
0
 def test_invalid_problem_number_reports_appropriate_error_message(self):
     main(["euler", "invalid"], self.output)
     self.assertIn("ERROR:", self.output.getvalue())
예제 #3
0
 def test_missing_problem_number_gives_usage_message(self):
     main(["euler"], self.output)
     self.assertIn("usage:", self.output.getvalue())
예제 #4
0
 def test_can_run_individual_problems_by_number(self):
     main(["euler", "p1"], self.output)
     self.assertIn("Problem p1:", self.output.getvalue())