https://www.postgresql.org/docs/9.5/static/reference-client.html
SHOW work_mem;
#!/bin/bash | |
ip netns del one | |
ip netns del two | |
ip netns del three | |
ip link del name virtual-bridge type bridge | |
iptables -F POSTROUTING -t nat |
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
------------ | |
-- Basics -- | |
------------ | |
-- Get indexes of tables |
import functools | |
class Computer: | |
@functools.singledispatchmethod | |
def __init__(self, *parts): | |
self.parts = " *** ".join(parts) | |
@__init__.register | |
def _(self, parts: dict): |
import functools | |
class Computer: | |
@functools.singledispatchmethod | |
def __init__(self, *parts): | |
self.parts = " *** ".join(parts) | |
def get_parts(self): | |
return self.parts |
import functools | |
class Computer: | |
@functools.singledispatchmethod | |
def __init__(self, *parts): | |
self.parts = " *** ".join(parts) | |
def get_parts(self): | |
return self.parts |
@patch.object( | |
UserController, "__init__", Mock(return_value=None) | |
) | |
def test_get_first_picture(self): | |
user = UserController() | |
user.picture = MagicMock() | |
self.assertEqual("Test 1", user.get_first_picture()) |
@patch.object( | |
UserController, "__init__", Mock(return_value=None) | |
) | |
def test_get_first_picture(self): | |
mock_app = MagicMock() | |
mock_app.dbal.all.return_value = ["Test 1", "Test 2"] | |
user = UserController() | |
user.picture = mock_app |
@patch.object( | |
UserController, "__init__", Mock(return_value=None) | |
) | |
def test_get_second_picture(self): | |
mock_app = MagicMock() | |
mock_app.dbal.all.return_value = ["Test 1", "Test 2"] | |
user = UserController() | |
user.picture = mock_app |