Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5101 Export detected_os from OSS Tools #5102

Merged
merged 2 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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