コード例 #1
0
ファイル: test_commands.py プロジェクト: yougov/pmxbot
	def test_motivate(self):
		"""
		Test that motivate actually works.
		"""
		subject = "foo"
		pre = karma.Karma.store.lookup(subject)
		res = commands.motivate(channel="#test", rest=subject)
		assert res == "you're doing good work, %s!" % subject
		post = karma.Karma.store.lookup(subject)
		assert post == pre + 1
コード例 #2
0
ファイル: test_commands.py プロジェクト: yougov/pmxbot
	def test_motivate_with_spaces(self):
		"""
		Test that motivate strips beginning and ending whitespace
		"""
		subject = "foo"
		pre = karma.Karma.store.lookup(subject)
		res = commands.motivate(channel="#test", rest="   %s \t  " % subject)
		assert res == "you're doing good work, %s!" % subject
		post = karma.Karma.store.lookup(subject)
		assert post == pre + 1
コード例 #3
0
ファイル: test_commands.py プロジェクト: calamnet/pmxbot
	def test_motivate(self):
		"""
		Test that motivate actually works.
		"""
		subject = "foo"
		pre = karma.Karma.store.lookup(subject)
		res = commands.motivate(channel="#test", rest=subject)
		assert res == "you're doing good work, %s!" % subject
		post = karma.Karma.store.lookup(subject)
		assert post == pre + 1
コード例 #4
0
ファイル: test_commands.py プロジェクト: calamnet/pmxbot
	def test_motivate_with_spaces(self):
		"""
		Test that motivate strips beginning and ending whitespace
		"""
		subject = "foo"
		pre = karma.Karma.store.lookup(subject)
		res = commands.motivate(channel="#test", rest="   %s \t  " % subject)
		assert res == "you're doing good work, %s!" % subject
		post = karma.Karma.store.lookup(subject)
		assert post == pre + 1
コード例 #5
0
ファイル: test_commands.py プロジェクト: calamnet/pmxbot
	def test_motivate_with_reason(self):
		"""
		Test that motivate ignores the reason
		"""
		subject = "foo"
		pre = karma.Karma.store.lookup(subject)
		res = commands.motivate(channel="#test", rest=" %s\tfor some really incredible reason" % subject)
		assert res == "you're doing good work, %s!" % subject
		post = karma.Karma.store.lookup(subject)
		assert post == pre + 1
コード例 #6
0
ファイル: test_commands.py プロジェクト: sd2k/pmxbot
	def test_motivate_with_reason(self):
		"""
		Test that motivate ignores the reason
		"""
		subject = "foo"
		pre = karma.Karma.store.lookup(subject)
		res = commands.motivate(channel="#test", rest=" %s\tfor some really incredible reason" % subject)
		assert res == "you're doing good work, %s!" % subject
		post = karma.Karma.store.lookup(subject)
		assert post == pre + 1