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

CameraTests   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_saveSnapshot() 0 9 1
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)
14
        newPicture = self.pictureCache.new()
15
        camera.takeSnapshot.assert_called_with(target, on=newPicture)
16
        self.pictureCache.keep.assert_called_with(newPicture)
17
18
19