How to use print_shape_doc method in localstack

Best Python code snippet using localstack_python

scaffold.py

Source:scaffold.py Github

copy

Full Screen

...87 def _print_as_class(self, output, base: str, doc=True, quote_types=False):88 output.write(f"class {self.shape.name}({base}):\n")89 q = '"' if quote_types else ""90 if doc:91 self.print_shape_doc(output, self.shape)92 if not self.shape.members:93 output.write(" pass\n")94 for k, v in self.shape.members.items():95 if k in self.shape.required_members:96 output.write(f" {k}: {q}{v.name}{q}\n")97 else:98 output.write(f" {k}: Optional[{q}{v.name}{q}]\n")99 def _print_as_typed_dict(self, output, doc=True, quote_types=False):100 name = self.shape.name101 q = '"' if quote_types else ""102 output.write('%s = TypedDict("%s", total=False, fields={\n' % (name, name))103 for k, v in self.shape.members.items():104 if k in self.shape.required_members:105 output.write(f' "{k}": {q}{v.name}{q},\n')106 else:107 output.write(f' "{k}": Optional[{q}{v.name}{q}],\n')108 output.write("})")109 def print_shape_doc(self, output, shape):110 html = shape.documentation111 import pypandoc112 doc = pypandoc.convert_text(html, "rst", format="html")113 rst = doc.strip()114 if rst:115 output.write(' """')116 output.write(f"{doc.strip()}\n")117 output.write(' """\n')118 def print_declaration(self, output, doc=True, quote_types=False):119 shape = self.shape120 q = '"' if quote_types else ""121 if isinstance(shape, StructureShape):122 self._print_structure_declaration(output, doc, quote_types)123 elif isinstance(shape, ListShape):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful