def __init__(self,
                 package_path=None,
                 owner_name=None,
                 owner_domain=None,
                 parent=None,
                 language_model=None):
        """Construct a Module.

    Args:
      package_path: (str) A '/' delimited path to this module.
      owner_name: (str) The name of the owner of the API, as they would like it
        to appear in library code. E.g "Best Buy"
      owner_domain: (str) The domain of the owner of the API, as they would like
        it to appear in library code.
      parent: (CodeObject) The parent of this element.
      language_model: (LanguageModel) The language we are targetting.
        Dynamically defaults to the parent's language model.
    """
        super(Module, self).__init__({},
                                     None,
                                     parent=parent,
                                     language_model=language_model)
        self._package_path = utilities.NoSpaces(package_path)
        self._owner_name = utilities.NoSpaces(owner_name)
        self._owner_domain = utilities.SanitizeDomain(owner_domain)
        self._name = None  # will be memoized on first call to name property
Пример #2
0
 def testNoSpaces(self):
     self.assertIsNone(utilities.NoSpaces(None))
     self.assertEquals('', utilities.NoSpaces(''))
     self.assertEquals('', utilities.NoSpaces(' '))
     self.assertEquals('abc', utilities.NoSpaces('a b  c '))