Example #1
0
 def test_execute_commands(self, subprocess_call):
     execute_commands(["ble"])
     subprocess_call.assert_called_with("ble", shell=True,
                                        cwd="/home/application/current")
Example #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")
Example #3
0
 def test_execute_commands(self, system):
     execute_commands(["ble"])
     system.assert_called_with("ble")
Example #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)
Example #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)
Example #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")
Example #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")