def test_invalid_inputs(self):
# Arguments
with self.assertRaises(TypeError):
- self.pakfire.execute("/usr/bin/sleep")
+ self.pakfire.execute("/command")
with self.assertRaises(TypeError):
- self.pakfire.execute(["/usr/bin/sleep", 1])
+ self.pakfire.execute(["/command", 1])
with self.assertRaises(TypeError):
- self.pakfire.execute(("/usr/bin/sleep", "--help"))
+ self.pakfire.execute(("/command", "--help"))
# Environment
with self.assertRaises(TypeError):
- self.pakfire.execute(["/usr/bin/sleep", "--help"], environ={"VAR1" : 1})
+ self.pakfire.execute(["/command", "--help"], environ={"VAR1" : 1})
with self.assertRaises(TypeError):
- self.pakfire.execute(["/usr/bin/sleep", "--help"], environ={1 : "VAL1"})
+ self.pakfire.execute(["/command", "--help"], environ={1 : "VAL1"})
with self.assertRaises(TypeError):
- self.pakfire.execute(["/usr/bin/sleep", "--help"], environ="VAR1=VAL1")
+ self.pakfire.execute(["/command", "--help"], environ="VAR1=VAL1")
def test_execute_non_existant_command(self):
"""
Executing non-existant commands should raise an error
"""
with self.assertRaises(pakfire.CommandExecutionError):
- self.pakfire.execute(["/usr/bin/does-not-exist"])
+ self.pakfire.execute(["/command-does-not-exist"])
def test_execute_output(self):
self.pakfire.execute(["/command", "echo", "123"])