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