Exemplo n.º 1
0
 def test_main_function_not_disables_pylxd_warnings_with_verbose(
         self, mock_help_action):
     _environ = os.environ.copy()
     try:
         os.environ.clear()
         main(['--verbose', 'help'])
         assert "PYLXD_WARNINGS" not in os.environ
     finally:
         os.environ.clear()
         os.environ.update(_environ)
Exemplo n.º 2
0
 def test_main_function_disables_pylxd_warnings_without_verbose(
         self, mock_help_action):
     _environ = os.environ.copy()
     try:
         os.environ.clear()
         main(['help'])
         assert "PYLXD_WARNINGS" in os.environ
         assert os.environ["PYLXD_WARNINGS"] == 'none'
     finally:
         os.environ.clear()
         os.environ.update(_environ)
Exemplo n.º 3
0
 def test_main_function_not_disables_pylxd_warnings_if_environemtvar_set(
         self, mock_help_action):
     _environ = os.environ.copy()
     try:
         os.environ.clear()
         os.environ["PYLXD_WARNINGS"] = 'foobar'
         main(['--verbose', 'help'])
         assert "PYLXD_WARNINGS" in os.environ
         assert os.environ["PYLXD_WARNINGS"] == 'foobar'
         main(['help'])
         assert "PYLXD_WARNINGS" in os.environ
         assert os.environ["PYLXD_WARNINGS"] == 'foobar'
     finally:
         os.environ.clear()
         os.environ.update(_environ)
Exemplo n.º 4
0
def test_main_function_can_run_a_lxdock_command(mock_help_action):
    main(['help'])
    assert mock_help_action.call_count == 1