Example #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"})
Example #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'})
Example #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), {})
Example #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})
Example #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")
Example #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), {})
Example #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})
Example #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")