This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://editorconfig.org | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 4 | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
end_of_line = lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
/* | |
* References are often confused with pointers but three major | |
* differences between references and pointers are: | |
* - You cannot have NULL references. You must always be able to assume | |
* that a reference is connected to a legitimate piece of storage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
// References in work. | |
int x(0); | |
int &ref = x; | |
x = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import doctest | |
import unittest | |
# Paths to one's Python modules | |
from app import models, views | |
def test_doctest_suit(): | |
test_suit = unittest.TestSuite() | |
test_suit.addTest(doctest.DocTestSuite(models)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
โโโ app | |
โย ย โโโ __init__.py | |
โย ย โโโ models.py | |
โย ย โโโ views.py | |
โโโ tests | |
โโโ __init__.py | |
โโโ test_models.py | |
โโโ test_views.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==================================================================== test session starts ===================================================================== | |
platform linux -- Python 3.6.9, pytest-5.3.2, py-1.8.0, pluggy-0.13.1 | |
rootdir: /home/vald/Projects/personal/doctests_discovery | |
collected 4 items | |
tests/test_models.py . [ 25%] | |
tests/test_package_doctests.py F [ 50%] | |
tests/test_views.py .F [100%] | |
========================================================================== FAILURES ========================================================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
cat > ~/.pdbrc.py <<EOF | |
import pdb | |
class Config(pdb.DefaultConfig): | |
sticky_by_default = True | |
truncate_long_lines = False | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /tmp || exit | |
echo "Downloading Postman ..." | |
wget -q https://dl.pstmn.io/download/latest/linux?arch=64 -O postman.tar.gz && \ | |
tar -xzf postman.tar.gz && \ | |
rm postman.tar.gz | |
echo "Installing to ~/.local/opt..." | |
test -d ~/.local/opt || mkdir ~/.local/opt | |
test -d ~/.local/opt/Postman && rm -rf ~/.local/opt/Postman |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
STATUS="$(sudo systemctl status systemd-resolved.service)" | |
# Stops the service if systemd-resolv.service is running. | |
if echo "${STATUS}" | grep -q "running" | |
then | |
sudo systemctl stop systemd-resolved.service > /dev/null 2>&1 | |
if sudo systemctl status systemd-resolved.service | grep -q "inactive" | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest.mock import patch | |
from core import utils | |
# specify what should be patched | |
patcher = patch('core.utils.PythonFilesLookUp') | |
# attach the original class to the variable because it will be modified | |
# when the patcher will start | |
original = utils.PythonFilesLookUp | |
# start the patcher and mock the class, this will produce a mock |