Beispiel #1
0
class PydiceTest(unittest.TestCase):
    def setUp(self):
        self.py = Pydice()

    def test_roll(self):
        "tests the roll() function of pydice.py"
        # test roll is an int
        self.assertIsInstance(self.py.roll(), int)
        # test roll is 6 or below
        self.assertGreater(7, self.py.roll())
        # test roll is greater than 0
        self.assertLess(0, self.py.roll())
Beispiel #2
0
class PydiceTest(unittest.TestCase):
	def setUp(self):
		self.py = Pydice() 

	def test_roll(self):
		"tests the roll() function of pydice.py"
		# test roll is an int
		self.assertIsInstance(self.py.roll(), int)
		# test roll is 6 or below
		self.assertGreater(7, self.py.roll())
		# test roll is greater than 0
		self.assertLess(0, self.py.roll())
Beispiel #3
0
 def setUp(self):
     self.py = Pydice()
Beispiel #4
0
	def setUp(self):
		self.py = Pydice()