예제 #1
0
 def test_cmdline_vars(self, monkeypatch):
     mock_run = Mock()
     monkeypatch.setattr(Run, "execute", mock_run)
     cmd_main(['x=1', 'y=abc'])
     assert '1' == doit_cmd.get_var('x')
     assert 'abc' == doit_cmd.get_var('y')
     assert None is doit_cmd.get_var('z')
예제 #2
0
    def test_cmdline_novars(self, monkeypatch):
        mock_run = Mock()
        monkeypatch.setattr(Run, "execute", mock_run)
        cmd_main(['x=1'])

        # Simulate the variable below not being initialized by a subprocess on
        # Windows. See https://github.com/pydoit/doit/issues/164.
        doit_cmd._CMDLINE_VARS = None
        assert None is doit_cmd.get_var('x')
예제 #3
0
 def check_success(self):
     """check if task should succeed based on GLOBAL parameter"""
     return doit_cmd.get_var('success', False)
예제 #4
0
 def test_cmdline_vars_not_opts(self, monkeypatch):
     mock_run = Mock()
     monkeypatch.setattr(Run, "execute", mock_run)
     cmd_main(['--z=5'])
     assert None == doit_cmd.get_var('--z')
예제 #5
0
 def test_cmdline_vars_not_opts(self, monkeypatch):
     mock_run = Mock()
     monkeypatch.setattr(Run, "execute", mock_run)
     cmd_main(['--z=5'])
     assert None == doit_cmd.get_var('--z')
 def check_success(self):
     """check if task should succeed based on GLOBAL parameter"""
     return doit_cmd.get_var('success', False)