def METHOD_NAME(self, cmd, expected_elements):
    """Run a command that should create a one element path.
    - Verify it requires beginpath.
    - Run with begin + endpath, and verify the path contains the expected elements.
    """
    with self.assertRaises(ShoebotError):
        # ShoebotError should be raised if you haven't called beginpath
        eval(cmd)
    beginpath()
    eval(cmd)  # run path command, e.g: moveto(40, 40)
    path = endpath(draw=False)
    self.assertCountEqual(path, expected_elements)