コード例 #1
0
ファイル: test_commands.py プロジェクト: jamwt/diesel-pmxbot
	def test_time_all(self):
		"""
		Check the time in "all" cities. Must include something that
		matches the time pattern on each line
		"""
		res = commands.googletime(c, e, "#test", "testrunner", "all")
		res = list(res)
		assert res
		for line in res:
			assert self.multi_time_pattern.match(line)
		assert len(res) == 4
コード例 #2
0
ファイル: test_commands.py プロジェクト: jamwt/diesel-pmxbot
	def test_time_one(self):
		"""
		Check the time in Washington, DC. Must match time_pattern.
		"""
		res = commands.googletime(c, e, "#test", "testrunner",
			"Washington, DC")
		res = list(res)
		assert res
		for line in res:
			assert self.single_time_pattern.match(line)
		assert len(res) == 1
コード例 #3
0
ファイル: test_commands.py プロジェクト: jamwt/diesel-pmxbot
	def test_time_three(self):
		"""
		Check the time in three cities. Must include something that
		matches the time pattern on each line
		"""
		res = commands.googletime(c, e, "#test", "testrunner",
			"Washington, DC | Palo Alto, CA | London")
		res = list(res)
		assert res
		for line in res:
			assert self.multi_time_pattern.match(line)
		assert len(res) == 3