mojo/public/tools/mojom/mojom/parse/parser_unittest.py
def testMultipleModuleStatements(self):
    """Tests an (invalid) .mojom with multiple module statements."""

    source = """\
        module foo;
        module bar;
        """
    with self.assertRaisesRegexp(
        parser.ParseError,
        r"^my_file\.mojom:2: Error: Multiple \"module\" statements not "
        r"allowed:\n *module bar;$"):
      parser.Parse(source, "my_file.mojom")
Tests an (invalid) .mojom with multiple module statements.
Tests an (invalid) .mojom with multiple module statements.
Tests an ( invalid ) . mojom with multiple module statements .
def testMultipleModuleStatements(self):
    source = """\
        module foo;
        module bar;
        """
    with self.assertRaisesRegexp(
        parser.ParseError,
        r"^my_file\.mojom:2: Error: Multiple \"module\" statements not "
        r"allowed:\n *module bar;$"):
      parser.Parse(source, "my_file.mojom")
def testMultipleModuleStatements ( self ) : source = """\
        module foo;
        module bar;
        """ with self . assertRaisesRegexp ( parser . ParseError , r"^my_file\.mojom:2: Error: Multiple \"module\" statements not " r"allowed:\n *module bar;$" ) : parser . Parse ( source , "my_file.mojom" )
Tests an (invalid) .mojom with multiple module statements.
Tests an ( invalid ) . mojom with multiple module statements .
"""Tests an (invalid) .mojom with multiple module statements."""
self