def onDrawOverview(self): """show dialog of the draw :returns: none """ separetebonus = False if self.lottodraw.data['sep_addit_numbers']: separetebonus = self.lottodraw.data['max_addit'] dlgdraw = DlgShowDrawing(self.lottodraw.ballnumber, self.lottodraw.data['max_draw'], self.lottodraw.ballbonus, highestbonus=separetebonus) dlgdraw.exec_()
def onbtn_draw_overview(self): """show dialog of the draw :returns: none """ separetebonus = False if self.lottodraw.data['sep_addit_numbers']: separetebonus = self.lottodraw.data['max_addit'] dlgdraw = DlgShowDrawing(self.lottodraw.ballnumber, self.lottodraw.data['max_draw'], self.lottodraw.ballbonus, highestbonus=separetebonus ) dlgdraw.exec_()
def test_ballnumber(self): """test with one ball numbers""" dialog = DlgShowDrawing([2], 5) self.assertTrue(dialog) self.assertEqual(dialog.btn_drawnumbers[0].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[1].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[2].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[3].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[4].isFlat(), True)
def test_twoballnumber(self): """test with two ball numbers""" dialog = DlgShowDrawing([3, 4], 6) self.assertTrue(dialog) self.assertEqual(dialog.btn_drawnumbers[0].text(), '1') self.assertEqual(dialog.btn_drawnumbers[0].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[1].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[2].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[3].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[4].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[5].isFlat(), True)
def test_bonusnumbers(self): """test ball numbers and bonus numbers in a maximal draw of 5 numbers """ dialog = DlgShowDrawing([2], 5, [1]) self.assertTrue(dialog) self.assertEqual(dialog.btn_drawnumbers[0].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[0].styleSheet(), 'color: blue;') self.assertEqual(dialog.btn_drawnumbers[1].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[1].styleSheet(), 'color: red;') self.assertEqual(dialog.btn_drawnumbers[2].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[2].styleSheet(), '') self.assertEqual(dialog.btn_drawnumbers[3].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[4].isFlat(), True)
def test_bonusnumbersseparate(self): """test separate bonus numbers :return: none """ dialog = DlgShowDrawing([2], 5, [1, 2], 3) self.assertTrue(dialog) self.assertEqual(dialog.btn_drawnumbers[0].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[1].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[2].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[3].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[4].isFlat(), True) self.assertEqual(dialog.btnnumerarybonus[0].isFlat(), False) self.assertEqual(dialog.btnnumerarybonus[1].isFlat(), False) self.assertEqual(dialog.btnnumerarybonus[2].isFlat(), True)
def test_samenumbers(self): """test the same ball numbers and bonus numbers in a maximal draw of 5 numbers :return: none """ dialog = DlgShowDrawing([3], 5, [3]) self.assertTrue(dialog) self.assertEqual(dialog.btn_drawnumbers[0].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[0].styleSheet(), '') self.assertEqual(dialog.btn_drawnumbers[1].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[1].styleSheet(), '') self.assertEqual(dialog.btn_drawnumbers[2].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[2].styleSheet(), 'color: red;') self.assertEqual(dialog.btn_drawnumbers[3].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[4].isFlat(), True)
def test_highernumbers(self): """test with higher draw numbers as the highest number in the draw in the ball numbers and in the bonus numbers :return: none """ dialog = DlgShowDrawing([2, 4, 6], 5, [1, 3, 5], 3) self.assertTrue(dialog) self.assertEqual(dialog.btn_drawnumbers[0].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[1].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[2].isFlat(), True) self.assertEqual(dialog.btn_drawnumbers[3].isFlat(), False) self.assertEqual(dialog.btn_drawnumbers[4].isFlat(), True) self.assertEqual(len(dialog.btn_drawnumbers), 5) self.assertEqual(dialog.btnnumerarybonus[0].isFlat(), False) self.assertEqual(dialog.btnnumerarybonus[1].isFlat(), True) self.assertEqual(dialog.btnnumerarybonus[2].isFlat(), False) self.assertEqual(len(dialog.btnnumerarybonus), 3)