def test_get(self): bytes_received = session_status.get('Bytes_received') assert isinstance(bytes_received, int) assert bytes_received >= 0 bytes_received_2 = session_status.get('Bytes_received') assert bytes_received_2 >= bytes_received cost = session_status.get('Last_query_cost') assert isinstance(cost, float) assert cost >= 0.00 with pytest.raises(ValueError) as excinfo: session_status.get('foo%') assert 'wildcards' in str(excinfo.value) with pytest.raises(KeyError): session_status.get('Does_not_exist')
def test_get(self): bytes_received = session_status.get('Bytes_received') self.assertTrue(isinstance(bytes_received, int)) self.assertGreaterEqual(bytes_received, 0) bytes_received_2 = session_status.get('Bytes_received') self.assertGreaterEqual(bytes_received_2, bytes_received) cost = session_status.get('Last_query_cost') self.assertTrue(isinstance(cost, float)) self.assertGreaterEqual(cost, 0.00) with self.assertRaises(ValueError) as cm: session_status.get('foo%') self.assertIn('wildcards', str(cm.exception)) with self.assertRaises(KeyError): session_status.get('Does_not_exist')
def test_get_non_existent(self): with pytest.raises(KeyError): session_status.get('Does_not_exist')
def test_get_bad_name(self): with pytest.raises(ValueError) as excinfo: session_status.get('foo%') assert 'wildcards' in str(excinfo.value)
def test_get_last_query_cost(self): cost = session_status.get('Last_query_cost') assert cost >= 0.0 and isinstance(cost, float)
def test_get_bytes_received(self): bytes_received = session_status.get('Bytes_received') assert bytes_received >= 0 and isinstance(bytes_received, int) bytes_received_2 = session_status.get('Bytes_received') assert bytes_received_2 >= bytes_received
def test_get_non_existent(self): with pytest.raises(KeyError): session_status.get('Does_not_exist')
def test_get_bad_name(self): with pytest.raises(ValueError) as excinfo: session_status.get('foo%') assert 'wildcards' in str(excinfo.value)
def test_get_last_query_cost(self): cost = session_status.get('Last_query_cost') assert cost >= 0.0 and isinstance(cost, float)
def test_get_bytes_received(self): bytes_received = session_status.get('Bytes_received') assert bytes_received >= 0 and isinstance(bytes_received, int) bytes_received_2 = session_status.get('Bytes_received') assert bytes_received_2 >= bytes_received