Run update-copyright.py.
[hooke.git] / test / wtk_driver.py
1 # Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
2 #
3 # This file is part of Hooke.
4 #
5 # Hooke is free software: you can redistribute it and/or modify it under the
6 # terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option) any
8 # later version.
9 #
10 # Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
13 # details.
14 #
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
17
18 """
19 Point data_logger to our test data.
20
21 >>> import os
22 >>> import os.path
23 >>> import data_logger
24 >>> data_logger.DEFAULT_PATH = os.path.join(
25 ...     os.getcwd(), 'test', 'data', 'vclamp_wtk')
26
27 Adjust Hooke in case we don't have calibcant installed.
28
29 >>> from hooke.hooke import Hooke, HookeRunner
30 >>> h = Hooke()
31 >>> h.config.set('wtk driver', 'cantilever calibration directory',
32 ...              '${DEFAULT}/calibrate_cantilever')
33 >>> h.load_drivers()
34
35 Proceed with the test itself.
36
37 >>> r = HookeRunner()
38 >>> playlist = os.path.join('test', 'data', 'vclamp_wtk', 'playlist')
39 >>> h = r.run_lines(h, ['load_playlist ' + playlist])
40 <FilePlaylist WTK>
41 Success
42 <BLANKLINE>
43 >>> h = r.run_lines(h, ['curve_info']) # doctest: +ELLIPSIS, +REPORT_UDIFF
44 name: 20100504144209_unfold
45 path: .../test/data/vclamp_wtk/unfold/20100504/20100504144209_unfold
46 driver: <hooke.driver.wtk.WTKDriver object at 0x...>
47 note: None
48 command stack: []
49 blocks: 2
50 block names: ['approach', 'retract']
51 block sizes: [(810, 2), (8001, 2)]
52 Success
53 <BLANKLINE>
54 """