Ejemplo n.º 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'}})
Ejemplo n.º 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'}})
Ejemplo n.º 3
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"},
                 },
             )