def setUp(self): hop = Hop() hop.counts = 10 hop.settle = 3 p1 = Position(detector='H1', isotope='Ar40') p2 = Position(detector='H2', isotope='Ar39') hop.positions = [p1, p2] hop2 = Hop() hop2.counts = 100 hop2.settle = 30 p1 = Position(detector='L1', isotope='Ar40') p2 = Position(detector='L2', isotope='Ar39') hop2.positions = [p1, p2] self.hop_sequence = HopSequence(hops=[hop, hop2])
class HopSequenceTestCase(unittest.TestCase): def setUp(self): hop = Hop() hop.counts = 10 hop.settle = 3 p1 = Position(detector='H1', isotope='Ar40') p2 = Position(detector='H2', isotope='Ar39') hop.positions = [p1, p2] hop2 = Hop() hop2.counts = 100 hop2.settle = 30 p1 = Position(detector='L1', isotope='Ar40') p2 = Position(detector='L2', isotope='Ar39') hop2.positions = [p1, p2] self.hop_sequence = HopSequence(hops=[hop, hop2]) def test_to_string(self): s = """('Ar40:H1, Ar39:H2', 10, 3) ('Ar40:L1, Ar39:L2', 100, 30)""" self.assertEqual(self.hop_sequence.to_string(), s)