@@ -61,7 +61,7 @@ def fake_run_as_root(run_args):
6161 exit_mock .assert_called_once ()
6262
6363
64- def test_upgrade_happy (cli , monkeypatch ):
64+ def test_upgrade (cli , monkeypatch ):
6565 monkeypatch .setattr (mytonctrl_module , "check_git" , lambda args , default_repo , text : ("author" , "repo" , "branch" , None ))
6666
6767 calls = {}
@@ -122,13 +122,18 @@ def fake_upgrade_btc_teleport(local, ton, reinstall=False, branch="master", user
122122 teleport_calls ["branch" ] = branch
123123 teleport_calls ["user" ] = user
124124 monkeypatch .setattr (mytonctrl_module , "upgrade_btc_teleport" , fake_upgrade_btc_teleport )
125- output = cli .execute ("upgrade" )
125+ output = cli .execute ("upgrade" , no_color = True )
126126 assert teleport_calls .get ("called" ) is True
127127 assert teleport_calls .get ("reinstall" ) is False
128- assert "Upgrade - \x1b [32mOK \x1b " in output
128+ assert "Upgrade - OK " in output
129129 assert "Error" not in output
130130 assert calls ["run_args" ] == ["bash" , upg_path , "-a" , "author" , "-r" , "repo" , "-b" , "branch" ]
131131
132+ monkeypatch .setattr (mytonctrl_module , "run_as_root" , lambda _ : 1 )
133+ output = cli .execute ("upgrade" , no_color = True )
134+ assert "Upgrade - Error" in output
135+
136+
132137def test_upgrade_btc_teleport (cli , monkeypatch , mocker : MockerFixture ):
133138 teleport_calls = {}
134139 def fake_upgrade_btc_teleport (local , ton , reinstall = False , branch = "master" , user = None ):
0 commit comments