예제 #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")
예제 #9
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")