def test_load_keyvalue_array(self):
        """Test loading an array of key/value pairs"""
        fd, path = tempfile.mkstemp(suffix=".json")
        try:
            array = [KEYVALUE, KEYVALUE_ALL]
            json_str = json.dumps(array, indent=4)
            LOG.info(json_str)
            with open(path, "a") as f:
                f.write(json_str)

            args = ["key", "load", path]
            retcode = self.shell.run(args)
            self.assertEqual(retcode, 0)
        finally:
            os.close(fd)
            os.unlink(path)
Test loading an array of key/value pairs
st2client/tests/unit/test_keyvalue.py