def test_system_info_xml(self): valid_xml = """<Objects>" <Object>" <Property Name="Key">platform_family</Property> <Property Name="Value">Windows</Property> </Object> </Objects>""" self.client.execute.return_value = valid_xml self.assertEqual(posh_ohai.system_info(self.client), {"platform_family": "Windows"})
def test_system_info_xml(self): valid_xml = '''<Objects>" <Object>" <Property Name="Key">platform_family</Property> <Property Name="Value">Windows</Property> </Object> </Objects>''' self.client.execute.return_value = valid_xml self.assertEqual(posh_ohai.system_info(self.client), {'platform_family': 'Windows'})
def test_system_info_json_with_motd(self): self.client.execute.return_value = "Hello world\n {}" self.assertEqual(posh_ohai.system_info(self.client), {})
def test_system_info_json(self): self.client.execute.return_value = '{"foo": 123}' self.assertEqual(posh_ohai.system_info(self.client), {'foo': 123})
def test_system_info(self): self.client.execute.return_value = "{}" posh_ohai.system_info(self.client) self.client.execute.assert_called_with("Import-Module -Name Posh-Ohai;" "Get-ComputerConfiguration")
def test_system_info_json(self): self.client.execute.return_value = '{"foo": 123}' self.assertEqual(posh_ohai.system_info(self.client), {"foo": 123})
def test_system_info(self): self.client.execute.return_value = "{}" posh_ohai.system_info(self.client) self.client.execute.assert_called_with("Get-ComputerConfiguration")