From e39866afdaa1c02ba937b639c7685152886815c0 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 22 May 2019 09:42:20 -0300 Subject: [PATCH] #5101 Export detected_os from OSS Tools (#5102) - Add alias for tools.oss.detected_os Signed-off-by: Uilian Ries --- conans/test/unittests/client/conf/detect/detected_os_test.py | 5 +++++ conans/tools.py | 1 + 2 files changed, 6 insertions(+) diff --git a/conans/test/unittests/client/conf/detect/detected_os_test.py b/conans/test/unittests/client/conf/detect/detected_os_test.py index e5a1aac9a03..1da5b708a14 100644 --- a/conans/test/unittests/client/conf/detect/detected_os_test.py +++ b/conans/test/unittests/client/conf/detect/detected_os_test.py @@ -5,6 +5,7 @@ import unittest from mock import mock from conans.client.tools.oss import detected_os, OSInfo +from conans import tools class DetectedOSTest(unittest.TestCase): @@ -44,3 +45,7 @@ def test_freebsd(self): def test_solaris(self): with mock.patch("platform.system", mock.MagicMock(return_value='SunOS')): self.assertEqual(detected_os(), "SunOS") + + def test_export_tools(self): + with mock.patch("platform.system", mock.MagicMock(return_value='FreeBSD')): + self.assertEqual(tools.detected_os(), "FreeBSD") diff --git a/conans/tools.py b/conans/tools.py index ee26518eaf0..5647ce86292 100644 --- a/conans/tools.py +++ b/conans/tools.py @@ -111,6 +111,7 @@ def replace_path_in_file(*args, **kwargs): # from conans.client.tools.oss args_to_string = tools_oss.args_to_string detected_architecture = tools_oss.detected_architecture +detected_os = tools_oss.detected_os OSInfo = tools_oss.OSInfo cross_building = tools_oss.cross_building get_cross_building_settings = tools_oss.get_cross_building_settings