Completed
Pull Request — master (#136)
by Jasper
01:19
created

CameraTests.test_saveSnapshot()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
1
from unittest import TestCase
2
from tests.ditest import DependencyInjectionTestBase
3
from mock import Mock, patch, sentinel
4
5
6
class CameraTests(DependencyInjectionTestBase):
7
8
    def test_saveSnapshot(self):
9
        from niprov.camera import Camera
10
        camera = Camera(self.dependencies)
11
        camera.takeSnapshot = Mock()
12
        target = Mock()
13
        camera.saveSnapshot(target, for_=sentinel.object)
14
        newPicture = self.pictureCache.new()
15
        camera.takeSnapshot.assert_called_with(target, on=newPicture)
16
        self.pictureCache.keep.assert_called_with(newPicture, sentinel.object)
17
18
19
20