コード例 #1
0
ファイル: app.py プロジェクト: nwpointer/proj3-ajax
def calc_times():
  """
  Calculates open/close times from miles, using rules 
  described at http://www.rusa.org/octime_alg.html.
  Expects one URL-encoded argument, the number of miles. 
  """
  app.logger.debug("Got a JSON request");
  miles = request.args.get('miles', 0, type=int)
  brevit = acpBrevit(miles)
  return jsonify(min=brevit[0], max=brevit[1])
コード例 #2
0
	def test_range1(self):
		self.assertEqual( acpBrevit(0), (60,0))
コード例 #3
0
	def test_Max(self):
		self.assertEqual( acpBrevit(200), (353,780))
コード例 #4
0
	def test_175(self):
		self.assertEqual( acpBrevit(175), (309,700))
コード例 #5
0
	def test_120(self):
		self.assertEqual( acpBrevit(120), (212,480))
コード例 #6
0
	def test_60(self):
		self.assertEqual( acpBrevit(60), (106,240))
コード例 #7
0
	def test_range1(self):
		self.assertEqual( acpBrevit(10), (17,40))