コード例 #1
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_shutdown(self, mock_method):
     """
     Position
     dsgrid shutdown
     """
     mock_method.return_value = True
     shell.main(["shutdown"])
コード例 #2
0
 def test_shutdown(self, mock_method):
     """
     Position
     dsgrid shutdown
     """
     mock_method.return_value = True
     shell.main(['shutdown'])
コード例 #3
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_start(self, mock_start, mock_is_running):
     """
     Positive
     dsgrid start
     """
     mock_is_running.return_value = False
     mock_start.return_value = True
     shell.main(["start"])
コード例 #4
0
 def test_start(self, mock_start, mock_is_running):
     """
     Positive
     dsgrid start
     """
     mock_is_running.return_value = False
     mock_start.return_value = True
     shell.main(['start'])
コード例 #5
0
    def test_start_while_running(self, mock_start, mock_is_running):
        """
        Negative: Grid is running
        dsgrid start
        """
        mock_is_running.return_value = True
        mock_start.return_value = True
        with patch('sys.stdout', devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(['start'])

        self.assertEqual(cm.exception.code, 1)
コード例 #6
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
    def test_start_while_running(self, mock_start, mock_is_running):
        """
        Negative: Grid is running
        dsgrid start
        """
        mock_is_running.return_value = True
        mock_start.return_value = True
        with patch("sys.stdout", devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(["start"])

        self.assertEqual(cm.exception.code, 1)
コード例 #7
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
    def test_start_but_container_fails(self, mock_start, mock_is_running):
        """
        Positive
        dsgrid start
        """
        mock_is_running.return_value = False
        mock_start.return_value = False
        with patch("sys.stdout", devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(["start"])

        self.assertEqual(cm.exception.code, 1)
コード例 #8
0
    def test_start_but_container_fails(self, mock_start, mock_is_running):
        """
        Positive
        dsgrid start
        """
        mock_is_running.return_value = False
        mock_start.return_value = False
        with patch('sys.stdout', devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(['start'])

        self.assertEqual(cm.exception.code, 1)
コード例 #9
0
 def test_nodes_unknown_action(self):
     with self.assertRaises(SystemExit) as cm:
         shell.main(['nodes', 'juggle'])
     self.assertEqual(cm.exception.code, 1)
コード例 #10
0
    def test_nodes_missing_action(self):
        with patch('sys.stdout', devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(['nodes'])

        self.assertEqual(cm.exception.code, 1)
コード例 #11
0
 def test_restart_nodes_specific_browser(self):
     shell.main(['nodes', 'restart', 'firefox'])
コード例 #12
0
 def test_add_node_but_container_fails(self, mock_method):
     mock_method.return_value = False
     with patch('sys.stdout', devnull):
         with self.assertRaises(SystemExit) as cm:
             shell.main(['nodes', 'add', 'firefox'])
     self.assertEqual(cm.exception.code, 1)
コード例 #13
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
 def test_restart_nodes(self):
     shell.main(['nodes', 'restart'])
コード例 #14
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
    def test_unknown_option(self):
        with self.assertRaises(SystemExit) as cm:
            shell.main(["shake"])

        self.assertEqual(cm.exception.code, 1)
コード例 #15
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_status_not_running(self, mock_method):
     mock_method.return_value = False
     # with patch('sys.stdout', devnull):
     with self.assertRaises(SystemExit) as cm:
         shell.main(["status"])
     self.assertEqual(cm.exception.code, 1)
コード例 #16
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_add_valid_browser(self, mock_method):
     mock_method.return_value = True
     shell.main(["nodes", "add", "firefox"])
コード例 #17
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_shutdown_while_not_running(self, mock_method):
     mock_method.return_value = False
     with patch("sys.stdout", devnull):
         with self.assertRaises(SystemExit) as cm:
             shell.main(["shutdown"])
     self.assertEqual(cm.exception.code, 1)
コード例 #18
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
 def test_add_valid_browser(self, mock_method):
     mock_method.return_value = True
     shell.main(['nodes', 'add', 'firefox'])
コード例 #19
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
 def test_add_browser_with_multiple(self, mock_method):
     mock_method.return_value = True
     shell.main(['nodes', 'add', 'firefox', '2'])
コード例 #20
0
 def test_status_running(self, mock_method):
     mock_method.return_value = True
     shell.main(['status'])
コード例 #21
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
 def test_stop_nodes(self):
     shell.main(['nodes', 'stop'])
コード例 #22
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
 def test_stop_nodes_specific_browser(self):
     shell.main(['nodes', 'stop', 'firefox'])
コード例 #23
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_status_running(self, mock_method):
     mock_method.return_value = True
     shell.main(["status"])
コード例 #24
0
 def test_add_browser_with_multiple(self, mock_method):
     mock_method.return_value = True
     shell.main(['nodes', 'add', 'firefox', '2'])
コード例 #25
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_add_browser_with_multiple(self, mock_method):
     mock_method.return_value = True
     shell.main(["nodes", "add", "firefox", "2"])
コード例 #26
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
    def test_add_node_invalid_browser(self):
        with patch('sys.stdout', devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(['nodes', 'add', 'netscape'])

        self.assertEqual(cm.exception.code, 1)
コード例 #27
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
    def test_add_node_invalid_browser(self):
        with patch("sys.stdout", devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(["nodes", "add", "netscape"])

        self.assertEqual(cm.exception.code, 1)
コード例 #28
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_add_node_but_container_fails(self, mock_method):
     mock_method.return_value = False
     with patch("sys.stdout", devnull):
         with self.assertRaises(SystemExit) as cm:
             shell.main(["nodes", "add", "firefox"])
     self.assertEqual(cm.exception.code, 1)
コード例 #29
0
 def test_add_valid_browser(self, mock_method):
     mock_method.return_value = True
     shell.main(['nodes', 'add', 'firefox'])
コード例 #30
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_restart_nodes(self):
     shell.main(["nodes", "restart"])
コード例 #31
0
    def test_add_node_invalid_browser(self):
        with patch('sys.stdout', devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(['nodes', 'add', 'netscape'])

        self.assertEqual(cm.exception.code, 1)
コード例 #32
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_restart_nodes_specific_browser(self):
     shell.main(["nodes", "restart", "firefox"])
コード例 #33
0
 def test_restart_nodes(self):
     shell.main(['nodes', 'restart'])
コード例 #34
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_stop_nodes(self):
     shell.main(["nodes", "stop"])
コード例 #35
0
 def test_stop_nodes(self):
     shell.main(['nodes', 'stop'])
コード例 #36
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
    def test_nodes_missing_action(self):
        with patch("sys.stdout", devnull):
            with self.assertRaises(SystemExit) as cm:
                shell.main(["nodes"])

        self.assertEqual(cm.exception.code, 1)
コード例 #37
0
 def test_stop_nodes_specific_browser(self):
     shell.main(['nodes', 'stop', 'firefox'])
コード例 #38
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_stop_nodes_specific_browser(self):
     shell.main(["nodes", "stop", "firefox"])
コード例 #39
0
 def test_status_not_running(self, mock_method):
     mock_method.return_value = False
     #with patch('sys.stdout', devnull):
     with self.assertRaises(SystemExit) as cm:
         shell.main(['status'])
     self.assertEqual(cm.exception.code, 1)
コード例 #40
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
 def test_nodes_unknown_action(self):
     with self.assertRaises(SystemExit) as cm:
         shell.main(["nodes", "juggle"])
     self.assertEqual(cm.exception.code, 1)
コード例 #41
0
    def test_unknown_option(self):
        with self.assertRaises(SystemExit) as cm:
            shell.main(['shake'])

        self.assertEqual(cm.exception.code, 1)
コード例 #42
0
ファイル: test_shell.py プロジェクト: CheRuisiBesares/dsgrid
 def test_restart_nodes_specific_browser(self):
     shell.main(['nodes', 'restart', 'firefox'])