Skip to content

Commit

Permalink
[tests] Fixed invalid hostnames in various tests #42
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Apr 3, 2016
1 parent 612959e commit abb63bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tests/openwisp/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestBackend(unittest.TestCase, _TabsMixin):
"""
config = {
"general": {
"hostname": "openwisp_test"
"hostname": "openwisp-test"
},
"interfaces": [
{
Expand Down Expand Up @@ -118,7 +118,7 @@ class TestBackend(unittest.TestCase, _TabsMixin):
def test_uci(self):
o = OpenWisp({
"general": {
"hostname": "openwisp_test"
"hostname": "openwisp-test"
}
})
tar = tarfile.open(fileobj=o.generate(), mode='r')
Expand All @@ -127,7 +127,7 @@ def test_uci(self):
expected = self._tabs("""package system
config system
option hostname 'openwisp_test'
option hostname 'openwisp-test'
option timezone 'UTC'
""")
self.assertEqual(contents, expected)
Expand Down
4 changes: 2 additions & 2 deletions tests/openwrt/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestSystemRenderer(unittest.TestCase, _TabsMixin):
def test_system(self):
o = OpenWrt({
"general": {
"hostname": "test_system",
"hostname": "test-system",
"timezone": "Europe/Rome",
"custom_setting": True,
"empty_setting1": None,
Expand All @@ -23,7 +23,7 @@ def test_system(self):
config system
option custom_setting '1'
option hostname 'test_system'
option hostname 'test-system'
option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
""")
self.assertEqual(o.render(), expected)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_empty_netjson(self):

def test_templates(self):
config = json.dumps({
'general': {'hostname': 'template_test'}
'general': {'hostname': 'template-test'}
})
template1 = json.dumps({
'interfaces': [
Expand Down Expand Up @@ -68,7 +68,7 @@ def test_templates(self):
command = """netjsonconfig --config '{0}' -b openwrt -m render --templates '{1}' '{2}'"""
command = command.format(config, template1, template2)
output = subprocess.check_output(command, shell=True).decode()
self.assertIn("hostname 'template_test'", output)
self.assertIn("hostname 'template-test'", output)
self.assertIn("interface 'eth0'", output)
self.assertIn("interface 'wlan0'", output)

Expand Down Expand Up @@ -101,7 +101,7 @@ def test_arg_exception(self):

def test_valid_arg(self):
config = json.dumps({
'general': {'hostname': 'template_test'},
'general': {'hostname': 'template-test'},
'files': [
{
'path': '/etc/test.txt',
Expand Down

0 comments on commit abb63bd

Please sign in to comment.