def test_get(self):
        running = global_status.get('Threads_running')
        assert isinstance(running, int)
        assert running >= 1

        cost = global_status.get('Last_query_cost')
        assert isinstance(cost, float)
        assert cost >= 0.0

        with pytest.raises(ValueError) as excinfo:
            global_status.get('foo%')
        assert 'wildcards' in str(excinfo.value)

        with pytest.raises(KeyError):
            global_status.get('Does_not_exist')
Example #2
0
    def test_get(self):
        running = global_status.get('Threads_running')
        self.assertTrue(isinstance(running, int))
        self.assertGreaterEqual(running, 1)

        cost = global_status.get('Last_query_cost')
        self.assertTrue(isinstance(cost, float))
        self.assertGreaterEqual(cost, 0.00)

        with self.assertRaises(ValueError) as cm:
            global_status.get('foo%')
        self.assertIn('wildcards', str(cm.exception))

        with self.assertRaises(KeyError):
            global_status.get('Does_not_exist')
Example #3
0
 def test_get_non_existent(self):
     with pytest.raises(KeyError):
         global_status.get('Does_not_exist')
Example #4
0
 def test_get_bad_name(self):
     with pytest.raises(ValueError) as excinfo:
         global_status.get('foo%')
     assert 'wildcards' in str(excinfo.value)
Example #5
0
 def test_get(self):
     running = global_status.get('Threads_running')
     assert running >= 1 and isinstance(running, int)
 def test_get_non_existent(self):
     with pytest.raises(KeyError):
         global_status.get('Does_not_exist')
 def test_get_bad_name(self):
     with pytest.raises(ValueError) as excinfo:
         global_status.get('foo%')
     assert 'wildcards' in str(excinfo.value)
 def test_get(self):
     running = global_status.get('Threads_running')
     assert running >= 1 and isinstance(running, int)