コード例 #1
0
	def test_isMine_Card(self):
		m = mock.Mock()
		player = mock.Mock()
		octgn = mock.Mock()
		card = mock.Mock()
		card.configure_mock( **{'owner': player})
		octgn.configure_mock( **{'me' : player})
		im = isMine(m)
		
		im( **{'octgn':octgn, 'card' : card})
		
		self.assertTrue(m.called)		
コード例 #2
0
	def test_isMine_CardGroup(self):
		m = mock.Mock()
		player = mock.Mock()
		octgn = mock.Mock()
		cardgroup = mock.Mock()
		cardgroup.configure_mock( **{'player': player})
		octgn.configure_mock( **{'me' : player})
		im = isMine(m)
		
		im( **{'octgn':octgn, 'cardgroup' : cardgroup})
		
		self.assertTrue(m.called)		
コード例 #3
0
	def test_isMine_Groups(self):
		m = mock.Mock()
		player = mock.Mock()
		octgn = mock.Mock()
		groups = [mock.Mock() for i in range(0, 3)]
		for g in groups:
			g.configure_mock( **{'player': player})
		octgn.configure_mock( **{'me' : player})
		im = isMine(m)
		
		im( **{'octgn':octgn, 'groups' : groups})
		
		self.assertTrue(m.called)