コード例 #1
0
 def test_length(self):
     """ Test Case to ensure the correct number of subjects are output"""
     result = randomization.block(100, 2, 4)
     self.assertEqual(len(result), 100)
     # Make sure that if the number of subjects is not divisible by the
     # block length, the result is of the correct length
     result = randomization.block(98, 2, 4)
     self.assertEqual(len(result), 98)
コード例 #2
0
 def test_max_run(self):
     """ Test Case to ensure the correct number of subjects are output"""
     result = randomization.block(100, 2, 6)
     max_run = run_length(result)
     self.assertTrue(max_run <= 6)