Commit 7f45fa10 authored by Jérome Perrin's avatar Jérome Perrin

tests: fix some trailing whitespaces and inconsistent indentations

parent 55ff948c
...@@ -31,7 +31,7 @@ import shutil ...@@ -31,7 +31,7 @@ import shutil
import tempfile import tempfile
import slapos.slap import slapos.slap
import slapos.cli.configure_local import slapos.cli.configure_local
from slapos.cli.configure_local import ConfigureLocalCommand, _createConfigurationDirectory from slapos.cli.configure_local import ConfigureLocalCommand, _createConfigurationDirectory
from slapos.cli.entry import SlapOSApp from slapos.cli.entry import SlapOSApp
from argparse import Namespace from argparse import Namespace
from six.moves.configparser import ConfigParser from six.moves.configparser import ConfigParser
......
...@@ -208,7 +208,7 @@ class RunPromise(GenericPromise): ...@@ -208,7 +208,7 @@ class RunPromise(GenericPromise):
"title": "%(name)s" "title": "%(name)s"
}] }]
}""" }"""
history_file = os.path.join(self.partition_dir, PROMISE_HISTORY_RESULT_FOLDER_NAME, '%s.history.json' % name) history_file = os.path.join(self.partition_dir, PROMISE_HISTORY_RESULT_FOLDER_NAME, '%s.history.json' % name)
self.assertTrue(os.path.exists(history_file)) self.assertTrue(os.path.exists(history_file))
with open(history_file) as f: with open(history_file) as f:
...@@ -411,7 +411,7 @@ class RunPromise(GenericPromise): ...@@ -411,7 +411,7 @@ class RunPromise(GenericPromise):
self.launcher.run() self.launcher.run()
self.assertTrue(os.path.exists(state_folder)) self.assertTrue(os.path.exists(state_folder))
self.assertTrue(os.path.exists(os.path.join(self.log_dir, 'my_promise.log'))) self.assertTrue(os.path.exists(os.path.join(self.log_dir, 'my_promise.log')))
self.assertSuccessResult("my_promise") self.assertSuccessResult("my_promise")
self.assertSuccessHistoryResult("my_promise") self.assertSuccessHistoryResult("my_promise")
self.assertSuccessStatsResult(1) self.assertSuccessStatsResult(1)
...@@ -1577,10 +1577,10 @@ class TestSlapOSGenericPromise(TestSlapOSPromiseMixin): ...@@ -1577,10 +1577,10 @@ class TestSlapOSGenericPromise(TestSlapOSPromiseMixin):
def test_promise_cleanup_plugin_dir(self): def test_promise_cleanup_plugin_dir(self):
stale_pyc = os.path.join(self.plugin_dir, 'stale.pyc') stale_pyc = os.path.join(self.plugin_dir, 'stale.pyc')
with open(stale_pyc, 'w') as fh: with open(stale_pyc, 'w') as fh:
fh.write('') fh.write('')
stale_pyo = os.path.join(self.plugin_dir, 'stale.pyo') stale_pyo = os.path.join(self.plugin_dir, 'stale.pyo')
with open(stale_pyo, 'w') as fh: with open(stale_pyo, 'w') as fh:
fh.write('') fh.write('')
self.initialisePromise() self.initialisePromise()
self.launcher.run() self.launcher.run()
self.assertFalse(os.path.exists(stale_pyc)) self.assertFalse(os.path.exists(stale_pyc))
...@@ -2021,4 +2021,3 @@ class RunPromise(GenericPromise): ...@@ -2021,4 +2021,3 @@ class RunPromise(GenericPromise):
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -40,18 +40,13 @@ class TestRegister(unittest.TestCase): ...@@ -40,18 +40,13 @@ class TestRegister(unittest.TestCase):
template = slapos.cli.register.fetch_configuration_template() template = slapos.cli.register.fetch_configuration_template()
self.assertNotEqual("", template) self.assertNotEqual("", template)
for entry in ['computer_id', for entry in ['computer_id',
'master_url', 'master_url',
'key_file', 'key_file',
'cert_file', 'cert_file',
'certificate_repository_path', 'certificate_repository_path',
'interface_name', 'interface_name',
'ipv4_local_network', 'ipv4_local_network',
'partition_amount', 'partition_amount',
'create_tap']: 'create_tap']:
self.assertTrue(entry in template, "%s is not in template (%s)" % (entry, template)) self.assertTrue(entry in template, "%s is not in template (%s)" % (entry, template))
...@@ -1471,7 +1471,7 @@ class TestOpenOrder(SlapMixin): ...@@ -1471,7 +1471,7 @@ class TestOpenOrder(SlapMixin):
}, },
"text_content": { "text_content": {
"title": "Parameter XML", "title": "Parameter XML",
"default": dict2xml({'_':json.dumps(parameter_dict)}), "default": dict2xml({'_': json.dumps(parameter_dict)}),
"key": "field_my_text_content", "key": "field_my_text_content",
"type": "TextAreaField" "type": "TextAreaField"
}, },
...@@ -1689,4 +1689,3 @@ class TestSoftwareProductCollection(SlapMixin): ...@@ -1689,4 +1689,3 @@ class TestSoftwareProductCollection(SlapMixin):
self.product_collection.get self.product_collection.get
) )
self.assertEqual(self.product_collection.foo, '0') self.assertEqual(self.product_collection.foo, '0')
...@@ -993,4 +993,4 @@ class TestFormatConfig(SlapformatMixin): ...@@ -993,4 +993,4 @@ class TestFormatConfig(SlapformatMixin):
# TODO add more tests with config file # TODO add more tests with config file
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment