test/test_vaspdir.rb in vasputils-0.0.3 vs test/test_vaspdir.rb in vasputils-0.0.4

- old
+ new

@@ -14,11 +14,32 @@ # assert_in_delta( cor, data, $tolerance ) # assert_raise( RuntimeError ){} class VaspDir < Comana attr_reader :mode - public :finished? + + def calculate + generated_files = [ + "CHG", + "CHGCAR", + "CONTCAR", + "DOSCAR", + "EIGENVAL", + "IBZKPT", + "OSZICAR", + "OUTCAR", + "PCDAT", + "WAVECAR", + "XDATCAR", + "machines", + "vasprun.xml", + ] + generated_files.map!{|i| "#{@dir}/#{i}"} + command = "touch #{generated_files.join(" ")}" + + system command + end end class TC_VaspDir < Test::Unit::TestCase @@ -65,11 +86,11 @@ assert_equal(false, @vd02.finished?) assert_equal(true , @vd03.finished?) end def test_calculate - lock_dir = "test/vaspdir/not-yet/lock" + lock_dir = "test/vaspdir/not-yet/comana_lock" Dir.rmdir(lock_dir) if Dir.exist?(lock_dir) #pp @vd00;exit #@vd00.calculate assert_nothing_raised{@vd00.calculate} @@ -79,11 +100,11 @@ assert(FileTest.exist? "test/vaspdir/not-yet/INCAR") assert(FileTest.exist? "test/vaspdir/not-yet/KPOINTS") assert(FileTest.exist? "test/vaspdir/not-yet/POSCAR") assert(FileTest.exist? "test/vaspdir/not-yet/POTCAR") - lock_dir = "test/vaspdir/not-yet/lock" + lock_dir = "test/vaspdir/not-yet/comana_lock" Dir.rmdir(lock_dir) if Dir.exist?(lock_dir) end def test_outcar assert_equal("test/vaspdir/started/OUTCAR", @vd02.outcar[:name]) @@ -112,12 +133,9 @@ def teardown GENERATED_FILES_VD00.each do |file| FileUtils.rm file if File.exist? file end - - #lock_dir = "test/vaspdir/not-yet/lock" - #Dir.rmdir(lock_dir) if Dir.exist?(lock_dir) end end