Exemplo n.º 1
0
	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
Exemplo n.º 2
0
	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
Exemplo n.º 3
0
	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
Exemplo n.º 4
0
	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
Exemplo n.º 5
0
	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
Exemplo n.º 6
0
	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