Esempio n. 1
0
	def test_00REGISTER(self):
		self.send(call('REGISTER',t0,t0))
		self.assertTrue(self.receive().startswith(PACKAGE_START))
		self.send(call('REGISTER',t1,t1))
		self.assertTrue(self.receive().startswith(PACKAGE_START))
		self.send(call('REGISTER',t2,t2))
		self.assertTrue(self.receive().startswith(PACKAGE_START))
Esempio n. 2
0
	def test_11LOOKUP(self):
		if self.loginAs(t0):
			self.send(call('LOOKUP',t0))
			self.assertEqual(self.receive(), easyResponse('LOOKUP',True))
			self.send(call('LOOKUP',t1))
			self.assertEqual(self.receive(), easyResponse('LOOKUP',True))
			self.send(call('LOOKUP',t2))
			self.assertEqual(self.receive(), easyResponse('LOOKUP',True))
Esempio n. 3
0
	def test_10TEST(self):
		if self.loginAs(t0):
			self.send(call('TEST'))
			self.assertEqual(self.receive(), easyResponse('TEST',True))
Esempio n. 4
0
	def test_01AUTH_FALSE(self):
		self.send(call('AUTH','\x03\x03\x03\x03\x03','000000'))
		self.assertEqual(self.receive(),easyResponse('LOGIN',False))
Esempio n. 5
0
	def test_01AUTH(self):
		self.send(call('AUTH',t0,t0))
		self.assertEqual(self.receive(),easyResponse('LOGIN',True))
Esempio n. 6
0
	def loginAs(self,tu,passwd=None):
		if passwd==None: passwd=tu
		self.send(call('AUTH',tu,passwd))
		return self.receive()==easyResponse('LOGIN',True)
Esempio n. 7
0
	def test_90REMOVE2(self):
		if self.loginAs(t2):
			self.send(call('REMOVE'))
			self.assertEqual(self.receive(), easyResponse('REMOVE',True))
Esempio n. 8
0
	def test_89PASSWD_LOGIN(self):
		if self.loginAs(t0,t0+'_'):
			self.send(call('PASSWD',t0+'_',t0))
			self.assertEqual(self.receive(), easyResponse('PASSWD',True))
		else: self.assertTrue(False)
Esempio n. 9
0
	def test_89PASSWD(self):
		if self.loginAs(t0):
			self.send(call('PASSWD',t0,t0+'_'))
			self.assertEqual(self.receive(), easyResponse('PASSWD',True))