# -*- coding: utf-8 -*- import collections import unittest import dice from scipy import stats class TestDice(unittest.TestCase): def setUp(self): self.__target = dice.Dice() def test_throw(self): # 6000回実行する result = [self.__target.throw() for n in range(0, 6000)] # 実行結果の集計 counted = collections.Counter(result) # イレギュラーな目が出ていないか確認 self.assertItemsEqual([1, 2, 3, 4, 5, 6], counted.keys()) # カイ二乗検定