Пример #1
0
 def test__replaces_any_whitespace_sequence_with_single_space(self):
     self.assertEqual('one two three',
                      normalise_whitespace('one   two\t\nthree'))
Пример #2
0
 def test__treats_punctuation_as_non_space(self):
     punctuation = '.?;:!'
     self.assertEqual(punctuation, normalise_whitespace(punctuation))
Пример #3
0
 def test__eliminates_trailing_space(self):
     self.assertEqual('word', normalise_whitespace('word '))
Пример #4
0
 def test__preserves_text_without_whitespace(self):
     word = factory.make_name('word')
     self.assertEqual(word, normalise_whitespace(word))
Пример #5
0
          "this list of networks is kept. It also supports specifying "
          "IPs or ACL names."),
     },
 },
 "ntp_servers": {
     "default": None,
     "form": HostListFormField,
     "form_kwargs": {
         "label":
         "Addresses of NTP servers",
         "required":
         False,
         "help_text":
         normalise_whitespace("""\
             NTP servers, specified as IP addresses or hostnames delimited
             by commas and/or spaces, to be used as time references for
             MAAS itself, the machines MAAS deploys, and devices that make
             use of MAAS's DHCP services.
         """),
     },
 },
 "ntp_external_only": {
     "default": False,
     "form": forms.BooleanField,
     "form_kwargs": {
         "label":
         "Use external NTP servers only",
         "required":
         False,
         "help_text":
         normalise_whitespace("""\
             Configure all region controller hosts, rack controller hosts,
Пример #6
0
         ("This domain should not collide with an upstream domain "
          "provided by the set upstream DNS.")
     }
 },
 'ntp_servers': {
     'default': None,
     'form': HostListFormField,
     'form_kwargs': {
         'label':
         "Addresses of NTP servers",
         'required':
         False,
         'help_text':
         normalise_whitespace("""\
             NTP servers, specified as IP addresses or hostnames delimited
             by commas and/or spaces, to be used as time references for
             MAAS itself, the machines MAAS deploys, and devices that make
             use of MAAS's DHCP services.
         """),
     }
 },
 'ntp_external_only': {
     'default': False,
     'form': forms.BooleanField,
     'form_kwargs': {
         'label':
         "Use external NTP servers only",
         'required':
         False,
         'help_text':
         normalise_whitespace("""\
             Configure all region controller hosts, rack controller hosts,
Пример #7
0
 def test_eliminates_trailing_space(self):
     self.assertEqual("word", normalise_whitespace("word "))