Broke config section of test/tutorial.py out into test/config.py
[hooke.git] / test / tutorial.py
index 58d2b10e7c8f825282706f493545899a4a4f4a3f..d35269771553015451d23e1d77c93af1df318f7d 100644 (file)
@@ -96,8 +96,8 @@ Success
 <BLANKLINE>
 >>> os.path.isfile('mylist.hkp')
 True
->>> h = r.run_lines(h, ['load_playlist --output_playlist other_list mylist'])
-<FilePlaylist other_list>
+>>> h = r.run_lines(h, ['load_playlist mylist.hkp'])
+<FilePlaylist mylist.hkp>
 Success
 <BLANKLINE>
 >>> if playlist_already_exists == False:
@@ -169,7 +169,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist other_list>
+<FilePlaylist mylist.hkp>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['previous_playlist'])
@@ -187,7 +187,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist other_list>
+<FilePlaylist mylist.hkp>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -209,7 +209,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist other_list>
+<FilePlaylist mylist.hkp>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -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*
 
@@ -253,10 +249,5 @@ Success
 
 *Configuring Hooke*
 
->>> h = r.run_lines(h, ['set_config conditions temperature 300.0'])
->>> h = r.run_lines(h, ['get_config conditions temperature'])
->>> h = r.run_lines(h, ['set_config conditions temperature 295.3'])
->>> h = r.run_lines(h, ['get_config conditions temperature'])
->>> h = r.run_lines(h, ['print_config'])
->>> h = r.run_lines(h, ['save_config'])
+See :file:`config.py`.
 """