Beispiel #1
0
    def test_protocol_addition_of_partials(self):
        p1 = Protocol()
        p1.add_instrument('A', 'p20')
        p1.add_container('A1', 'microplate.96')
        p1.transfer('A1:A1', 'A1:A2', ul=10)

        p2 = Protocol.partial()
        p2.add_container('A2', 'microplate.96')
        p2.transfer('A1:A1', 'A1:A3', ul=20)
        p2.transfer('A2:A1', 'A2:A4', ul=15)

        p3 = Protocol.partial()
        p3.add_container('A3', 'microplate.96')
        p3.transfer('A1:A1', 'A1:A3', ul=20)
        p3.transfer('A1:A1', 'A3:A4', ul=15)

        p4 = Protocol()
        p4.add_instrument('A', 'p20')
        p4.add_container('A1', 'microplate.96')
        p4.add_container('A2', 'microplate.96')
        p4.add_container('A3', 'microplate.96')
        p4.transfer('A1:A1', 'A1:A2', ul=10)
        p4.transfer('A1:A1', 'A1:A3', ul=20)
        p4.transfer('A2:A1', 'A2:A4', ul=15)
        p4.transfer('A1:A1', 'A1:A3', ul=20)
        p4.transfer('A1:A1', 'A3:A4', ul=15)

        self.assertEqual(p4, p1 + p2 + p3)
Beispiel #2
0
 def test_valid_partial_protocol_export(self):
     p = Protocol.partial()
     p.add_instrument('A', 'p10')
     p.add_container("A1", "microplate.96")
     p.transfer('A1:A1', 'A1:A3', ul=1)
     # This should export because there are no Partial problems.
     p.export(JSONFormatter)
Beispiel #3
0
 def test_valid_partial_protocol_run(self):
     p = Protocol.partial()
     p.add_instrument('A', 'p10')
     p.add_container("A1", "microplate.96")
     p.transfer('A1:A1', 'A1:A3', ul=1)
     # This should run because there are no Partial problems.
     p.run_all()
Beispiel #4
0
    def test_protocol_added_to_partial(self):
        p1 = Protocol()
        p1.add_instrument('A', 'p20')
        p1.add_container('A1', 'microplate.96')
        p1.transfer('A1:A1', 'A1:A2', ul=10)

        p2 = Protocol.partial()
        p2.add_container('A2', 'microplate.96')
        p2.transfer('A1:A1', 'A1:A3', ul=20)
        p2.transfer('A2:A1', 'A2:A4', ul=15)

        with self.assertRaises(TypeError):
            p2 + p1
Beispiel #5
0
 def test_partial_protocol_export(self):
     p = Protocol.partial()
     p.transfer('A1:A1', 'A1:A3', ul=1)
     with self.assertRaises(x.PartialProtocolException):
         # This shouldn't export because it's not valid.
         p.export(JSONFormatter)
Beispiel #6
0
 def test_partial_protocol_run(self):
     p = Protocol.partial()
     p.transfer('A1:A1', 'A1:A3', ul=1)
     with self.assertRaises(x.PartialProtocolException):
         # This shouldn't run because it's not valid.
         p.run_all()
Beispiel #7
0
 def test_partial_protocol(self):
     p = Protocol.partial()
     p.transfer('A1:A1', 'A1:A3', ul=1)