Skip to content

Commit

Permalink
#5101 Export detected_os from OSS Tools (#5102)
Browse files Browse the repository at this point in the history
- Add alias for tools.oss.detected_os

Signed-off-by: Uilian Ries <uilianries@gmail.com>
  • Loading branch information
uilianries authored and jgsogo committed May 22, 2019
1 parent 5bb2fee commit e39866a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conans/test/unittests/client/conf/detect/detected_os_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")
1 change: 1 addition & 0 deletions conans/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e39866a

Please sign in to comment.