def test_make_targz_with_name(self, mock_exec, mock_makedirs): self.assertEqual(bu.make_targz('/test/path', 'testname'), 'testname') mock_exec.assert_called_with('tar', '-czf', 'testname', '--directory', '/test/path', '.', logged=True)
def test_make_targz(self, mock_uuid, mock_exec, mock_makedirs): self.assertEqual(bu.make_targz('/test/path'), 'fake_uuid.tar.gz') mock_exec.assert_called_with('tar', '-czf', 'fake_uuid.tar.gz', '--directory', '/test/path', '.', logged=True)