Beispiel #1
0
    def test_load_cmd(self):
        # Make sure _load_cmd will always do nothing to a base cmd
        for cmd_name, cmd_ref in BASE_CMDS.iteritems():
            result = self.target._load_cmd(cmd_name, cmd_ref)
            self.assertTrue(isOttoCmd(result))

        # Make sure all refs for installed packs are paths...
        self.target.load_pack(PACK_NAME, PACK_DIR)
        test_pack = self.target.cmds_by_pack[PACK_NAME]
        for cmd_name, cmd_ref in test_pack.iteritems():
            self.assertTrue(isfile(cmd_ref))

            # ... and that they return from _load_cmd as an OttoCmd
            result = self.target._load_cmd(cmd_name, cmd_ref)
            self.assertTrue(isOttoCmd(result))