Пример #1
0
    def Run(self, args):
        """Run the get register parameters command."""
        client = registrations.RegistrationsClient()

        location_ref = args.CONCEPTS.location.Parse()

        domain = util.NormalizeDomainName(args.domain)
        return client.RetrieveRegisterParameters(location_ref, domain)
Пример #2
0
  def Run(self, args):
    """Run the get register parameters command."""
    api_version = registrations.GetApiVersionFromArgs(args)
    client = registrations.RegistrationsClient(api_version)

    location_ref = args.CONCEPTS.location.Parse()

    domain = util.NormalizeDomainName(args.domain)

    if domain != args.domain:
      log.status.Print(
          'Domain name \'{}\' has been normalized to equivalent \'{}\'.'.format(
              args.domain, domain))

    return client.RetrieveRegisterParameters(location_ref, domain)
Пример #3
0
 def testError(self, domain):
     with self.assertRaises(exceptions.Error):
         util.NormalizeDomainName(domain)
Пример #4
0
 def testNormalized(self, domain, normalized):
     self.assertEqual(util.NormalizeDomainName(domain), normalized)
Пример #5
0
 def testError(self):
     for domain in ['xn--ą.com', 'foo..', '.foo', 'x' * 70]:
         with self.assertRaises(exceptions.Error):
             util.NormalizeDomainName(domain)
Пример #6
0
 def testNormalized(self):
     for (domain, normalized) in [('foo.com', 'foo.com'),
                                  ('FoO.cOm.', 'foo.com'),
                                  ('Cześć.點看.com',
                                   'xn--cze-spa33b.xn--c1yn36f.com')]:
         self.assertEqual(util.NormalizeDomainName(domain), normalized)