def test_length(self): """ Test Case to ensure the correct number of subjects are output""" result = randomization.random_block(100, 2, [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.random_block(99, 2, [2, 4]) self.assertEqual(len(result), 99)
def test_max_run(self): """ Test Case to ensure the correct number of subjects are output""" result = randomization.random_block(100, 2, [4, 6]) max_run = run_length(result) self.assertTrue(max_run <= 6)