Guest User

Untitled

a guest
Aug 3rd, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. # coding=utf-8
  2. # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
  3. # Licensed under the Apache License, Version 2.0 (see LICENSE).
  4.  
  5. from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
  6. unicode_literals, with_statement)
  7.  
  8. from pants.backend.core.tasks.task import Task
  9. from pants.pantsd.subsystems.pants_daemon_launcher import PantsDaemonLauncher
  10. from pants_test.base_test import BaseTest
  11.  
  12.  
  13. class DummyTask(Task):
  14. """A placeholder task used as a hint to BaseTest to initialize the subsystem."""
  15. @classmethod
  16. def options_scope(cls):
  17. return 'dummy-pants-daemon-launcher-task'
  18.  
  19. @classmethod
  20. def global_subsystems(cls):
  21. return Task.global_subsystems() + (PantsDaemonLauncher,)
  22.  
  23.  
  24. class TestPantsDaemonLauncher(BaseTest):
  25. @classmethod
  26. def task_type(cls):
  27. return DummyTask
  28.  
  29. def setUp(self):
  30. BaseTest.setUp(self)
  31. self.context()
  32.  
  33. def test_options_defaults(self):
  34. pdl = PantsDaemonLauncher.global_instance()
  35.  
  36. self.assertIsFalse(pdl.options.enabled)
  37. self.assertEquals(pdl.options.http_host, '127.0.0.1')
  38. self.assertIsNone(pdl.options.http_port)
  39. self.assertIsNone(pdl.options.log_dir)
  40. self.assertIsNone(pdl.options.log_level)
Advertisement
Add Comment
Please, Sign In to add comment