JAL-3390 unit tests and command and menu refinements
[jalview.git] / test / jalview / ext / pymol / PymolCommandsTest.java
index 90d0cc7..8beee96 100644 (file)
@@ -335,4 +335,39 @@ public class PymolCommandsTest
             "p.jv_side_chain_binding_='<html>metal <a href=\"http:a.b.c/x\"> &#39;ion!'");
     assertEquals(commands.get(0), expected3);
   }
+
+  @Test(groups = "Functional")
+  public void testHideAll()
+  {
+    StructureCommandI cmd = testee.hideAll();
+    assertEquals(cmd, new StructureCommand("hide", "everything"));
+  }
+
+  @Test(groups = "Functional")
+  public void testHideChain()
+  {
+    StructureCommandI cmd = testee.hideChain("1.1", "B");
+    assertEquals(cmd, new StructureCommand("hide", "1.1//B//"));
+  }
+
+  @Test(groups = "Functional")
+  public void testShowStructures()
+  {
+    /*
+     * with nothing excluded
+     */
+    StructureCommandI cmd = testee.showStructures(null);
+    assertEquals(cmd, new StructureCommand("show", "cartoon"));
+
+    /*
+     * restricted to specified positions
+     */
+    AtomSpecModel restrictTo = new AtomSpecModel();
+    restrictTo.addRange("1.1", 12, 20, "A");
+    restrictTo.addRange("1.1", 30, 35, "A");
+    restrictTo.addRange("2.1", 11, 30, "B");
+    cmd = testee.showStructures(restrictTo);
+    assertEquals(cmd, new StructureCommand("show", "cartoon",
+            "1.1//A/12-20+30-35/ 2.1//B/11-30/"));
+  }
 }