def METHOD_NAME(self):
    with self.assertRaisesRegex(ValueError, "frames"):
        go.Figure({"frames": [{"frames": []}]})
    figure = go.Figure()
    figure.frames = [{}]
    with self.assertRaisesRegex(ValueError, "frames"):
        figure.to_plotly_json()["frames"][0]["frames"] = []
        figure.frames[0].frames = []