This file contains 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
def do_it(token, logger): | |
try: | |
tm = AMODEL.objects.get(unique_id=token) | |
tm.delete() | |
except Exception as e: | |
logger.error("...") | |
class FakeLogger: | |
def __init__(self): |
This file contains 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
@patch("module.file.BASE_PATH", 'tests/fixtures') | |
def test_organisation_to_es_document(): | |
# do the test normally | |
This file contains 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
default_bar_format = '{desc}{percentage:3.0f}%|{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}]' | |
red_bar_format = '{desc}{percentage:3.0f}%|\033[91m{bar}\033[00m| {n_fmt}/{total_fmt} [{elapsed}<{remaining}, {rate_fmt}]' |
This file contains 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://archive.is/6V2bl |
This file contains 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
sympton: | |
[chfw@ gui]$ cat /home/chfw/.gem/ruby/extensions/x86-linux/ffi-1.9.10/gem_make.out | |
/usr/bin/ruby -r ./siteconf20160225-10482-1jrwbf5.rb extconf.rb | |
checking for ffi.h... *** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of necessary | |
libraries and/or headers. Check the mkmf.log file for more details. You may | |
need configuration options. | |
Provided configuration options: |
This file contains 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
more details here https://github.com/angular/angular.js/issues/13794 |
This file contains 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
for test that has a dependency on base64 | |
Error: [$injector:unpr] Unknown provider: $base64Provider <- $base64 <- <- Xcomponent | |
to get rid of it, | |
1) include bower_components/angular-base64/angular-base64.js in karma.conf.js | |
2) in the test case, put this along with others | |
This file contains 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
it's been challenging to do that simple task, which is put a print statement in the emptied module file. when it comes to testing, | |
the first block is to how to test the output? one solution is to mock sys.stdout, the other is to wrap print in a function and patch it. | |
the second block is the module is already loaded and won't be loaded again. Hence you need to reload it. for reload, py2 and py3 had a | |
difference in where the reload comes from. here is the code to get around. | |
try: | |
reload | |
except NameError: | |
from imp import reload |
This file contains 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
def production centos has no connection to internet except serving port | |
background production machine was not set up by you, hence you need to perform addtional setup. | |
1. get a replica of production centos and connect it to internet | |
2. `repotrack emacs -u |xargs wget` | |
exception: | |
if architecture differs, e.g. i386 local but x86_64 in production, you can do |
This file contains 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
INSERT INTO USER_TABLE VALUES (SEQ_USER.NEXTVAL, 's', 'x'); |
OlderNewer