示例#1
0
 def test_memory(self):
     '''
     Test to this tests the memory for read and write operations.
     '''
     with patch.dict(sysbench.__salt__,
                     {'cmd.run': MagicMock(return_value={'A': 'a'})}):
         with patch.object(sysbench, '_parser', return_value={'A': 'a'}):
             self.assertEqual(sysbench.memory(),
                              {'Operation: read Scope: local':
                               {'A': 'a'},
                               'Operation: write Scope: local':
                               {'A': 'a'},
                               'Operation: read Scope: global':
                               {'A': 'a'},
                               'Operation: write Scope: global':
                               {'A': 'a'}})
示例#2
0
 def test_memory(self):
     '''
     Test to this tests the memory for read and write operations.
     '''
     with patch.dict(sysbench.__salt__,
                     {'cmd.run': MagicMock(return_value={'A': 'a'})}):
         with patch.object(sysbench, '_parser', return_value={'A': 'a'}):
             self.assertEqual(sysbench.memory(),
                              {'Operation: read Scope: local':
                               {'A': 'a'},
                               'Operation: write Scope: local':
                               {'A': 'a'},
                               'Operation: read Scope: global':
                               {'A': 'a'},
                               'Operation: write Scope: global':
                               {'A': 'a'}})
 def test_memory(self):
     """
     Test to this tests the memory for read and write operations.
     """
     with patch.dict(
         sysbench.__salt__, {"cmd.run": MagicMock(return_value={"A": "a"})}
     ):
         with patch.object(sysbench, "_parser", return_value={"A": "a"}):
             self.assertEqual(
                 sysbench.memory(),
                 {
                     "Operation: read Scope: local": {"A": "a"},
                     "Operation: write Scope: local": {"A": "a"},
                     "Operation: read Scope: global": {"A": "a"},
                     "Operation: write Scope: global": {"A": "a"},
                 },
             )