Esempio n. 1
0
 def test_iname_str2pywbem_correct_path4(self):
     path = iname_str2pywbem(props,
             """Uint16Property=0""")
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertIs(None, path.namespace)
     self.assertIs(None, path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(1, len(path.keybindings))
     self.assertIn("Uint16Property", path)
     self.assertEqual(0, path["Uint16property"])
Esempio n. 2
0
 def test_iname_str2pywbem_correct_path4(self):
     path = iname_str2pywbem(props,
             """AnyClass.Uint16Property=0""")
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertIs(None, path.namespace)
     self.assertEqual("AnyClass", path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(1, len(path.keybindings))
     self.assertIn("Uint16Property", path)
     self.assertEqual(0, path["Uint16property"])
Esempio n. 3
0
 def test_iname_str2pywbem_correct_path3(self):
     path = iname_str2pywbem(props,
             'StringProperty="short , \\"= string"')
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertIs(None, path.namespace)
     self.assertIs(None, path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(1, len(path.keybindings))
     self.assertIn("StringProperty", path)
     self.assertEqual('short , "= string', path["StringProperty"])
Esempio n. 4
0
 def test_iname_str2pywbem_correct_path3(self):
     path = iname_str2pywbem(props,
             'AnyClass.StringProperty="short , \\"= string"')
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertIs(None, path.namespace)
     self.assertEqual("AnyClass", path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(1, len(path.keybindings))
     self.assertIn("StringProperty", path)
     self.assertEqual('short , "= string', path["StringProperty"])
Esempio n. 5
0
 def test_iname_str2pywbem_correct_path2(self):
     path = iname_str2pywbem(props,
             """LMI_YawnTest.StringProperty="short \\ \\"\\\\ string\\"","""
             """Sint32Property=-10,BooleanProperty=FALSE""")
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertIs(None, path.namespace)
     self.assertEqual("LMI_YawnTest", path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(3, len(path.keybindings))
     self.assertIn("StringProperty", path)
     self.assertIn("Sint32Property", path)
     self.assertIn("BooleanProperty", path)
     self.assertEqual('short  "\\ string"', path["StringProperty"])
     self.assertIsInstance(path['Sint32Property'], pywbem.Sint32)
     self.assertEqual(pywbem.Sint32(-10), path['Sint32Property'])
     self.assertEqual(False, path['BooleanProperty'])
Esempio n. 6
0
 def test_iname_str2pywbem_correct_path1(self):
     path = iname_str2pywbem(props,
             """root/cimv2:LMI_YawnTest.StringProperty="short string","""
             """Uint16Property=10,BooleanProperty=TRUE""")
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertEqual("root/cimv2", path.namespace)
     self.assertEqual("LMI_YawnTest", path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(3, len(path.keybindings))
     self.assertIn("StringProperty", path)
     self.assertIn("Uint16Property", path)
     self.assertIn("BooleanProperty", path)
     self.assertEqual("short string", path["StringProperty"])
     self.assertIsInstance(path['Uint16Property'], pywbem.Uint16)
     self.assertEqual(pywbem.Uint16(10), path['Uint16Property'])
     self.assertEqual(True, path['BooleanProperty'])
Esempio n. 7
0
 def test_iname_str2pywbem_correct_path2(self):
     path = iname_str2pywbem(props,
             """LMI_YawnTest.StringProperty="short \\ \\"\\\\ string\\"","""
             """Sint32Property=-10,BooleanProperty=FALSE""")
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertIs(None, path.namespace)
     self.assertEqual("LMI_YawnTest", path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(3, len(path.keybindings))
     self.assertIn("StringProperty", path)
     self.assertIn("Sint32Property", path)
     self.assertIn("BooleanProperty", path)
     self.assertEqual('short  "\\ string"', path["StringProperty"])
     self.assertIsInstance(path['Sint32Property'], pywbem.Sint32)
     self.assertEqual(pywbem.Sint32(-10), path['Sint32Property'])
     self.assertEqual(False, path['BooleanProperty'])
Esempio n. 8
0
 def test_iname_str2pywbem_correct_path1(self):
     path = iname_str2pywbem(props,
             """root/cimv2:LMI_YawnTest.StringProperty="short string","""
             """Uint16Property=10,BooleanProperty=TRUE""")
     self.assertIsInstance(path, pywbem.CIMInstanceName)
     self.assertEqual("root/cimv2", path.namespace)
     self.assertEqual("LMI_YawnTest", path.classname)
     self.assertIsInstance(path.keybindings, (dict, pywbem.NocaseDict))
     self.assertEqual(3, len(path.keybindings))
     self.assertIn("StringProperty", path)
     self.assertIn("Uint16Property", path)
     self.assertIn("BooleanProperty", path)
     self.assertEqual("short string", path["StringProperty"])
     self.assertIsInstance(path['Uint16Property'], pywbem.Uint16)
     self.assertEqual(pywbem.Uint16(10), path['Uint16Property'])
     self.assertEqual(True, path['BooleanProperty'])