X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fpymol%2FPymolManagerTest.java;fp=test%2Fjalview%2Fext%2Fpymol%2FPymolManagerTest.java;h=c415ace7e98781e00eb5a4a40ace6d4d2912de8d;hb=74e963518532e173a8b026bf0de00993ab678ad0;hp=19b779d56559fa5f07f08cce224786ae0810b477;hpb=b145d2b4a617f452801953c1b49dae6b65521f14;p=jalview.git diff --git a/test/jalview/ext/pymol/PymolManagerTest.java b/test/jalview/ext/pymol/PymolManagerTest.java index 19b779d..c415ace 100644 --- a/test/jalview/ext/pymol/PymolManagerTest.java +++ b/test/jalview/ext/pymol/PymolManagerTest.java @@ -1,11 +1,14 @@ package jalview.ext.pymol; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; -import jalview.structure.StructureCommand; +import java.util.List; import org.testng.annotations.Test; +import jalview.structure.StructureCommand; + public class PymolManagerTest { @Test(groups = "Functional") @@ -23,4 +26,39 @@ public class PymolManagerTest + "all" + ""); } + + @Test(groups = "Functional") + public void testGetPymolPaths() + { + /* + * OSX + */ + List paths = PymolManager.getPymolPaths("Mac OS X"); + assertEquals(paths.size(), 1); + assertTrue( + paths.contains("/Applications/PyMOL.app/Contents/MacOS/PyMOL")); + + /* + * Linux + */ + paths = PymolManager.getPymolPaths("Linux i386 1.5.0"); + assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL")); + assertTrue(paths.contains("/usr/local/bin/PyMOL")); + assertTrue(paths.contains("/usr/bin/PyMOL")); + assertTrue(paths.contains("/usr/local/pymol/bin/PyMOL")); + assertTrue(paths + .contains(System.getProperty("user.home") + "/opt/bin/PyMOL")); + + /* + * Windows + */ + paths = PymolManager.getPymolPaths("Windows 10"); + assertTrue(paths.isEmpty()); // TODO - Windows paths + + /* + * Other + */ + paths = PymolManager.getPymolPaths("VAX/VMS"); + assertTrue(paths.isEmpty()); + } }