Ejemplo n.º 1
0
 def test_execute_commands(self, subprocess_call):
     execute_commands(["ble"])
     subprocess_call.assert_called_with("ble", shell=True,
                                        cwd="/home/application/current")
Ejemplo n.º 2
0
 def test_execute_commands_specific_cwd(self, subprocess_call):
     execute_commands(["ble"], working_dir="/tmp")
     subprocess_call.assert_called_with("ble", shell=True,
                                        cwd="/tmp")
Ejemplo n.º 3
0
 def test_execute_commands(self, system):
     execute_commands(["ble"])
     system.assert_called_with("ble")
Ejemplo n.º 4
0
 def test_execute_commands_failure(self, subprocess_call):
     subprocess_call.return_value = 7
     with self.assertRaises(SystemExit) as cm:
         execute_commands(["ble"])
     exc = cm.exception
     self.assertEqual(7, exc.code)
Ejemplo n.º 5
0
 def test_execute_commands_failure(self, subprocess_call):
     subprocess_call.return_value = 7
     with self.assertRaises(SystemExit) as cm:
         execute_commands(["ble"])
     exc = cm.exception
     self.assertEqual(7, exc.code)
Ejemplo n.º 6
0
 def test_execute_commands_specific_cwd(self, subprocess_call):
     subprocess_call.return_value = 0
     execute_commands(["ble"], working_dir="/tmp")
     subprocess_call.assert_called_with("ble", shell=True, cwd="/tmp")
Ejemplo n.º 7
0
 def test_execute_commands(self, subprocess_call):
     subprocess_call.return_value = 0
     execute_commands(["ble"])
     subprocess_call.assert_called_with("ble",
                                        shell=True,
                                        cwd="/home/application/current")