예제 #1
0
def test_load():
    stream = Mock()
    stream.load_count.return_value = 1
    stream.load_body.return_value = 3
    with patch('SerializeService.Unpack') as m:
        m.__enter__.return_value = True
        g = LoadService(stream).load()
    assert ScoreService.calculate(g) == 3
예제 #2
0
 def draw_score(self, frames, index):
     score = ScoreService.calculate_frames(frames[:index])
     self.context.draw_score(score)