From 48979a497969a5c32e6bdd0fbd7baddf48cd1ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 23 Feb 2016 15:29:33 +0100 Subject: [PATCH] [tests] Fix wrong checks in buildinstall tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were asserts that actually did not test anything. They should have checked that koji is called with correct arguments. Signed-off-by: Lubomír Sedlář --- tests/test_buildinstall.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index c3b52686..5b91b4f7 100755 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -411,7 +411,10 @@ class BuildinstallThreadTestCase(PungiTestCase): [mock.call('rrt', 'x86_64', cmd, channel=None, use_shell=True, task_id=True, packages=['strace', 'lorax'], mounts=[self.topdir])]) - run_runroot_cmd(get_runroot_cmd.return_value, log_file='/log/buildinstall-Server.x86_64.log') + self.assertItemsEqual( + run_runroot_cmd.mock_calls, + [mock.call(get_runroot_cmd.return_value, + log_file=self.topdir + '/logs/x86_64/buildinstall-Server.x86_64.log')]) with open(self.topdir + '/logs/x86_64/buildinstall-Server-RPMs.x86_64.log') as f: rpms = f.read().strip().split('\n') self.assertItemsEqual(rpms, ['bash', 'zsh']) @@ -450,8 +453,10 @@ class BuildinstallThreadTestCase(PungiTestCase): [mock.call('rrt', 'x86_64', cmd, channel=None, use_shell=True, task_id=True, packages=['strace', 'anaconda'], mounts=[self.topdir])]) - run_runroot_cmd(get_runroot_cmd.return_value, - log_file=self.topdir + '/logs/buildinstall.x86_64.log') + self.assertItemsEqual( + run_runroot_cmd.mock_calls, + [mock.call(get_runroot_cmd.return_value, + log_file=self.topdir + '/logs/x86_64/buildinstall.x86_64.log')]) with open(self.topdir + '/logs/x86_64/buildinstall-RPMs.x86_64.log') as f: rpms = f.read().strip().split('\n') self.assertItemsEqual(rpms, ['bash', 'zsh'])