示例#1
0
	def test_password_specific(self, length):
		"""
		Test the password command (with a length argument >= 4).
		"""
		res = commands.password(str(length))
		assert len(res) == int(length)
		assert any(char in res for char in string.ascii_letters)
		assert any(char in res for char in string.digits)
		assert any(char in res for char in string.punctuation)
示例#2
0
	def test_password_specific_short(self, length):
		"""
		Test the password command with a length argument < 4.

		With passwords this short we can't guarantee they'll
		contain one of each character set.
		"""
		res = commands.password(str(length))
		assert len(res) == int(length)
示例#3
0
	def test_password_specific_short(self, length):
		"""
		Test the password command with a length argument < 4.

		With passwords this short we can't guarantee they'll
		contain one of each character set.
		"""
		res = commands.password(str(length))
		assert len(res) == int(length)
示例#4
0
	def test_password_specific(self, length):
		"""
		Test the password command (with a length argument >= 4).
		"""
		res = commands.password(str(length))
		assert len(res) == int(length)
		assert any(char in res for char in string.ascii_letters)
		assert any(char in res for char in string.digits)
		assert any(char in res for char in string.punctuation)
示例#5
0
	def test_password(self):
		"""
		Test the default password command.

		Result should include at least one ascii character, digit,
		and punctuation character.
		"""
		res = commands.password('')
		assert len(res) == 12
		assert any(char in res for char in string.ascii_letters)
		assert any(char in res for char in string.digits)
		assert any(char in res for char in string.punctuation)
示例#6
0
	def test_password(self):
		"""
		Test the default password command.

		Result should include at least one ascii character, digit,
		and punctuation character.
		"""
		res = commands.password('')
		assert len(res) == 12
		assert any(char in res for char in string.ascii_letters)
		assert any(char in res for char in string.digits)
		assert any(char in res for char in string.punctuation)
示例#7
0
	def test_password_nonint(self):
		"""
		Test the password command with a non-integer argument.
		"""
		res = commands.password('test')
		assert res == 'need an integer password length!'
示例#8
0
	def test_password_nonint(self):
		"""
		Test the password command with a non-integer argument.
		"""
		res = commands.password('test')
		assert res == 'need an integer password length!'