コード例 #1
0
ファイル: cli_test.py プロジェクト: matti-kariluoma/spreads
def test_capture_no_target_page(config, mock_driver_mgr, mock_plugin_mgr,
                                tmpdir):
    config['path'] = unicode(tmpdir)
    mock_driver_mgr.return_value.driver.target_pages = False
    with pytest.raises(DeviceException):
        cli.capture(config)
    mock_driver_mgr.return_value.driver.target_pages = True
コード例 #2
0
def test_capture(tty, termios, stdin, select, config, capsys, tmpdir):
    select.return_value = ([stdin], [], [])
    stdin.read.side_effect = chain(repeat('b', 3), 'r', 'f')
    config['path'] = unicode(tmpdir)
    cli.capture(config)
    assert stdin.read.call_count == 5
    last_status = capsys.readouterr()[0].split('\r')[-1]
    assert " 6 pages " in last_status
コード例 #3
0
ファイル: cli_test.py プロジェクト: markvdb/spreads
 def test_capture(self):
     cli.getch = Mock(side_effect=chain(repeat('b', 3), 'c'))
     cli.get_devices = Mock(return_value=self.devices)
     cli.capture()
     assert cli.getch.call_count == 4
     assert cli.workflow.prepare_capture.call_count == 1
     assert cli.workflow.capture.call_count == 3
     assert cli.workflow.finish_capture.call_count == 1
コード例 #4
0
ファイル: cli_test.py プロジェクト: Gunirus/spreads
 def test_capture(self):
     self.workflow.config['capture']['capture_keys'] = ["b", " "]
     cli.getch = Mock(side_effect=chain(repeat('b', 3), 'f'))
     cli.capture(self.workflow)
     assert cli.getch.call_count == 4
     assert self.workflow.prepare_capture.call_count == 1
     assert self.workflow.capture.call_count == 3
     assert self.workflow.finish_capture.call_count == 1
コード例 #5
0
ファイル: cli_test.py プロジェクト: Josuex09/spreads
 def test_capture(self):
     cli.getch = Mock(side_effect=chain(repeat('b', 3), 'c'))
     cli.get_devices = Mock(return_value=self.devices)
     cli.capture()
     assert cli.getch.call_count == 4
     assert cli.workflow.prepare_capture.call_count == 1
     assert cli.workflow.capture.call_count == 3
     assert cli.workflow.finish_capture.call_count == 1
コード例 #6
0
ファイル: cli_test.py プロジェクト: 5up3rD4n1/spreads
def test_capture(tty, termios, stdin, select, config, capsys, tmpdir):
    select.return_value = ([stdin], [], [])
    stdin.read.side_effect = chain(repeat('b', 3), 'r', 'f')
    config['path'] = unicode(tmpdir)
    cli.capture(config)
    assert stdin.read.call_count == 5
    last_status = capsys.readouterr()[0].split('\r')[-1]
    assert " 6 pages " in last_status
コード例 #7
0
ファイル: cli_test.py プロジェクト: matti-kariluoma/spreads
def test_capture_nodevices(config, mock_driver_mgr, mock_plugin_mgr, tmpdir):
    config['path'] = unicode(tmpdir)
    mock_driver_mgr.return_value.driver.num_devices = 0
    with pytest.raises(DeviceException):
        cli.capture(config)
    mock_driver_mgr.return_value.driver.num_devices = 2
コード例 #8
0
ファイル: cli_test.py プロジェクト: markvdb/spreads
 def test_capture_noorientation(self):
     self.devices[0].orientation = None
     cli.getch = Mock(return_value='c')
     cli.get_devices = Mock(return_value=self.devices)
     cli.capture()
コード例 #9
0
ファイル: cli_test.py プロジェクト: markvdb/spreads
 def test_capture_nodevices(self):
     cli.getch = Mock(return_value=' ')
     cli.get_devices = Mock(return_value=[])
     cli.capture()
コード例 #10
0
ファイル: cli_test.py プロジェクト: 5up3rD4n1/spreads
def test_capture_nodevices(config, tmpdir):
    config['path'] = unicode(tmpdir)
    TestDriver.num_devices = 0
    with pytest.raises(DeviceException):
        cli.capture(config)
    TestDriver.num_devices = 2
コード例 #11
0
ファイル: cli_test.py プロジェクト: Josuex09/spreads
 def test_capture_nodevices(self):
     cli.getch = Mock(return_value=' ')
     cli.get_devices = Mock(return_value=[])
     cli.capture()
コード例 #12
0
ファイル: cli_test.py プロジェクト: Gunirus/spreads
 def test_capture_no_target_page(self):
     self.workflow.devices[0].target_page = None
     cli.getch = Mock(return_value='c')
     with pytest.raises(DeviceException) as excinfo:
         cli.capture(self.workflow)
コード例 #13
0
ファイル: cli_test.py プロジェクト: Gunirus/spreads
 def test_capture_nodevices(self):
     cli.getch = Mock(return_value=' ')
     self.workflow.devices = []
     with pytest.raises(DeviceException) as excinfo:
         cli.capture(self.workflow)
コード例 #14
0
ファイル: cli_test.py プロジェクト: 5up3rD4n1/spreads
def test_capture_no_target_page(config, tmpdir):
    config['path'] = unicode(tmpdir)
    TestDriver.target_pages = False
    with pytest.raises(DeviceException):
        cli.capture(config)
    TestDriver.target_pages = True
コード例 #15
0
def test_capture_nodevices(config, tmpdir):
    config['path'] = unicode(tmpdir)
    TestDriver.num_devices = 0
    with pytest.raises(DeviceException):
        cli.capture(config)
    TestDriver.num_devices = 2
コード例 #16
0
def test_capture_no_target_page(config, tmpdir):
    config['path'] = unicode(tmpdir)
    TestDriver.target_pages = False
    with pytest.raises(DeviceException):
        cli.capture(config)
    TestDriver.target_pages = True
コード例 #17
0
ファイル: cli_test.py プロジェクト: Josuex09/spreads
 def test_capture_noorientation(self):
     self.devices[0].orientation = None
     cli.getch = Mock(return_value='c')
     cli.get_devices = Mock(return_value=self.devices)
     cli.capture()