summaryrefslogtreecommitdiff
path: root/tests/unittests/test_distros/test_hostname.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-08-10 09:06:15 -0600
committerScott Moser <smoser@ubuntu.com>2016-08-10 09:06:15 -0600
commitc3c3dc693c14175e110b5fe125d4d5f98ace9700 (patch)
tree8858702c2c8a6ad4bf1bb861a4565e0a9c28e588 /tests/unittests/test_distros/test_hostname.py
parent5bd3493d732e5b1902872958e8681f17cbc81ce5 (diff)
downloadcloud-init-trunk.tar.gz
README: Mention move of revision control to git.HEADtrunk
cloud-init development has moved its revision control to git. It is available at https://code.launchpad.net/cloud-init Clone with git clone https://git.launchpad.net/cloud-init or git clone git+ssh://git.launchpad.net/cloud-init For more information see https://git.launchpad.net/cloud-init/tree/HACKING.rst
Diffstat (limited to 'tests/unittests/test_distros/test_hostname.py')
-rw-r--r--tests/unittests/test_distros/test_hostname.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/tests/unittests/test_distros/test_hostname.py b/tests/unittests/test_distros/test_hostname.py
deleted file mode 100644
index 5f28a868..00000000
--- a/tests/unittests/test_distros/test_hostname.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import unittest
-
-from cloudinit.distros.parsers import hostname
-
-
-BASE_HOSTNAME = '''
-# My super-duper-hostname
-
-blahblah
-
-'''
-BASE_HOSTNAME = BASE_HOSTNAME.strip()
-
-
-class TestHostnameHelper(unittest.TestCase):
- def test_parse_same(self):
- hn = hostname.HostnameConf(BASE_HOSTNAME)
- self.assertEqual(str(hn).strip(), BASE_HOSTNAME)
- self.assertEqual(hn.hostname, 'blahblah')
-
- def test_no_adjust_hostname(self):
- hn = hostname.HostnameConf(BASE_HOSTNAME)
- prev_name = hn.hostname
- hn.set_hostname("")
- self.assertEqual(hn.hostname, prev_name)
-
- def test_adjust_hostname(self):
- hn = hostname.HostnameConf(BASE_HOSTNAME)
- prev_name = hn.hostname
- self.assertEqual(prev_name, 'blahblah')
- hn.set_hostname("bbbbd")
- self.assertEqual(hn.hostname, 'bbbbd')
- expected_out = '''
-# My super-duper-hostname
-
-bbbbd
-'''
- self.assertEqual(str(hn).strip(), expected_out.strip())