def setUp(self): TestCase.setUp(self) experimental_kratios = {29: (0.2, 0.0), 79: (0.8, 0.0)} initial_composition = {29: 0.5, 79: 0.5} self.it = SimpleIterator(experimental_kratios, initial_composition)
class TestSimpleIterator(TestCase): def setUp(self): TestCase.setUp(self) experimental_kratios = {29: (0.2, 0.0), 79: (0.8, 0.0)} initial_composition = {29: 0.5, 79: 0.5} self.it = SimpleIterator(experimental_kratios, initial_composition) def tearDown(self): TestCase.tearDown(self) def testskeleton(self): self.assertTrue(True) def testnext(self): calculated_kratios = {29: (0.3, 0.0), 79: (0.7, 0.0)} composition = self.it.next(calculated_kratios) self.assertAlmostEqual(0.3333, composition[29], 4) self.assertAlmostEqual(0.5714, composition[79], 4)