def test_load_keyvalue_user(self):
        """Test loading of key/value pair with the optional user field"""
        fd, path = tempfile.mkstemp(suffix=".json")
        try:
            with open(path, "a") as f:
                f.write(json.dumps(KEYVALUE_USER, indent=4))

            args = ["key", "load", path]
            retcode = self.shell.run(args)
            self.assertEqual(retcode, 0)
        finally:
            os.close(fd)
            os.unlink(path)
Test loading of key/value pair with the optional user field
st2client/tests/unit/test_keyvalue.py