示例#1
0
 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"})
示例#2
0
 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'})
示例#3
0
 def test_system_info_json_with_motd(self):
     self.client.execute.return_value = "Hello world\n {}"
     self.assertEqual(posh_ohai.system_info(self.client), {})
示例#4
0
 def test_system_info_json(self):
     self.client.execute.return_value = '{"foo": 123}'
     self.assertEqual(posh_ohai.system_info(self.client), {'foo': 123})
示例#5
0
 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")
示例#6
0
 def test_system_info_json_with_motd(self):
     self.client.execute.return_value = "Hello world\n {}"
     self.assertEqual(posh_ohai.system_info(self.client), {})
示例#7
0
 def test_system_info_json(self):
     self.client.execute.return_value = '{"foo": 123}'
     self.assertEqual(posh_ohai.system_info(self.client), {"foo": 123})
示例#8
0
 def test_system_info(self):
     self.client.execute.return_value = "{}"
     posh_ohai.system_info(self.client)
     self.client.execute.assert_called_with("Get-ComputerConfiguration")
 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")