Added 'save config'. Adjusted test/tutorial.py (and test/ in general) passes.
[hooke.git] / test / tutorial.py
index 32992ef5db77e3ee38650f193e9af7476c32c671..967cda8498f57afd472b2e790ff1747b34f02bdd 100644 (file)
@@ -219,31 +219,27 @@ Success
 
 *Taking notes*
 
->>> h = r.run_lines(h, ['''set_note "Hi there.\\nI'm a note"'''])
-Success
-<BLANKLINE>
->>> h = r.run_lines(h, ['note_filter_playlist --output_playlist filtered'])
->>> h = r.run_lines(h, ['get_playlist'])
->>> h = r.run_lines(h, ['jump_to_playlist -- -1'])
->>> h = r.run_lines(h, ['get_playlist'])
->>> h = r.run_lines(h, ['get_curve'])
->>> h = r.run_lines(h, ['curve_index'])
->>> h = r.run_lines(h, ['jump_to_curve -- -1'])
->>> h = r.run_lines(h, ['get_curve'])
->>> h = r.run_lines(h, ['curve_index'])
->>> h = r.run_lines(h, ['get_note'])
->>> h = r.run_lines(h, ['set_note ""'])
->>> h = r.run_lines(h, ['get_note'])
+See :file:`note.py`.
 
 *Exporting curves*
 
->>> os.path.exists('mycurve.dat')
->>> h = r.run_lines(h, ['export_bock --output mycurve.dat'])
+>>> export_already_exists = os.path.exists('mycurve.dat')
+>>> export_already_exists
+False
+>>> h = r.run_lines(h, ['export_block --output mycurve.dat'])
+Success
+<BLANKLINE>
 >>> os.path.isfile('mycurve.dat')
+True
+>>> if export_already_exists == False:
+...    os.remove('mycurve.dat')
 
 *Measuring distances and forces*
 
->>> h = r.run_lines(h, ['delta 300 500'])
+>>> h = r.run_lines(h, ['delta 300 500'])  # doctest: +ELLIPSIS
+[('z piezo (m)', -4.913...e-08), ('deflection (m)', -2.834...e-08)]
+Success
+<BLANKLINE>
 
 *Worm like chain and freely jointed chain fitting*
 
@@ -254,9 +250,29 @@ Success
 *Configuring Hooke*
 
 >>> h = r.run_lines(h, ['set_config conditions temperature 300.0'])
+Success
+<BLANKLINE>
 >>> h = r.run_lines(h, ['get_config conditions temperature'])
+300.0
+Success
+<BLANKLINE>
 >>> h = r.run_lines(h, ['set_config conditions temperature 295.3'])
+Success
+<BLANKLINE>
 >>> h = r.run_lines(h, ['get_config conditions temperature'])
->>> h = r.run_lines(h, ['print_config'])
+295.3
+Success
+<BLANKLINE>
+>>> h = r.run_lines(h, ['print_config'])  # doctest: +ELLIPSIS
+# Default environmental conditions in case they are not specified in
+# the force curve data.  Configuration options in this section are
+# available to every plugin.
+[conditions]
+# Temperature in Kelvin
+temperature = 295.3
+<BLANKLINE>
+...
 >>> h = r.run_lines(h, ['save_config'])
+Success
+<BLANKLINE>
 """