Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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!'
Example #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!'