我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用distutils.util()。
def __init__(self, host, port, timeoutSeconds=180): self._mock_intent = distutils.util.strtobool( os.getenv("MYRA_MOCK_PREDICT_INTENT", "0")) if self._mock_intent: return self.host = host self.port = port self.session = requests.session() self.server = "http://%s:%s" % (host, port) self.timeoutSeconds = timeoutSeconds
def setUp(self): super(StubsTest, self).setUp() self.platform = sys.platform self.mox = mox.Mox() self.mox.StubOutWithMock(locale, 'setlocale') self.mox.StubOutWithMock(util, 'get_platform') self.mox.StubOutWithMock(stubs.FakeFile, 'is_file_accessible')