def test_get_cmd(self): plugin = ProcfileWatcher("", "", 1) plugin.call = Mock() plugin.call.return_value = {"options": {"cmd": "ble"}} cmd = plugin.get_cmd("name") self.assertEqual("ble", cmd) plugin.call.assert_called_with("get", name="name", keys=["cmd"])
def test_reload_procfile_update_cmds(self): plugin = ProcfileWatcher("", "", 1) plugin.call = Mock() plugin.call.return_value = {"statuses": {"name": "name", "cmd": "cmd"}} plugin.get_cmd = Mock() plugin.get_cmd.return_value = "cmd" plugin.procfile_path = os.path.join(os.path.dirname(__file__), "testdata/Procfile3") plugin.reload_procfile() plugin.get_cmd.assert_called_with("name") plugin.call.assert_called_with("set", name="name", options={'cmd': 'cmd2'})