Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jabdoa2 committed Nov 11, 2016
1 parent fc700b8 commit c66680f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
5 changes: 5 additions & 0 deletions mpf/tests/machine_files/playfield_transfer/config/config.yaml
Expand Up @@ -10,6 +10,11 @@ playfield_transfers:
captures_from: playfield1
eject_target: playfield2

transfer2:
transfer_events: transfer_ball
captures_from: playfield1
eject_target: playfield2

playfields:
playfield1:
label: Playfield 1
Expand Down
21 changes: 20 additions & 1 deletion mpf/tests/test_PlayfieldTransfer.py
Expand Up @@ -9,7 +9,7 @@ def getConfigFile(self):
def getMachinePath(self):
return 'tests/machine_files/playfield_transfer/'

def testBallPassThrough(self):
def testBallPassThroughSwitch(self):
# test pass from pf1 to pf2
pf1 = self.machine.ball_devices['playfield1']
pf2 = self.machine.ball_devices['playfield2']
Expand All @@ -27,3 +27,22 @@ def testBallPassThrough(self):
self.assertEqual(1, pf1.available_balls)
self.assertEqual(3, pf2.balls)
self.assertEqual(3, pf2.available_balls)

def testBallPassThroughEvent(self):
# test pass from pf1 to pf2
pf1 = self.machine.ball_devices['playfield1']
pf2 = self.machine.ball_devices['playfield2']

self.set_num_balls_known(4)
pf1.balls = 2
pf1.available_balls = 2
pf2.balls = 2
pf2.available_balls = 2

self.post_event("transfer_ball")
self.advance_time_and_run(2)

self.assertEqual(1, pf1.balls)
self.assertEqual(1, pf1.available_balls)
self.assertEqual(3, pf2.balls)
self.assertEqual(3, pf2.available_balls)

0 comments on commit c66680f

Please sign in to comment.