Skip to content

Instantly share code, notes, and snippets.

View fivunlm's full-sized avatar

Fernando Damian Lopez fivunlm

  • Argentina
View GitHub Profile
#!/usr/bin/python3
import argparse
import logging
import os
import sys
LOG_DIR = '/var/log/'
[TestClass]
public class Test
{
private IApplication MockApp(IScreenService screenService, IMessageRouterService messageRouterService,
IXACService xacService, IDataService dataService)
{
var application = Mock.Interface<IApplication>();
Expect.Once.PropertyGet(() => application.ScreenService).Returns(screenService);
Expect.Once.PropertyGet(() => application.MsgRouterService).Returns(messageRouterService);
Expect.Once.PropertyGet(() => application.XACService).Returns(xacService);
class SomeTestCase(unittest.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
self.testbed.init_memcache_stub()
ndb.get_context().clear_cache()
self.app = main.app.test_client()
# Diff is 804 characters long. Set self.maxDiff to None to see it.
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import {Component, Directive, Injectable, Input, NgModule} from '@angular/core'
import {Subject, Subscriber} from "rxjs";
import {NavigationStart} from "@angular/router";
@Injectable()
export class ActivatedRouteStub {
// ActivatedRoute.params is Observable
#!/bin/bash
export WORKSPACE=`pwd`
# Create/Activate virtualenv
virtualenv venv -p python3.6
source venv/bin/activate
# Install/Update pytest
pip install -U pytest
#include <iostream>
#include <dlfcn.h>
int main() {
using std::cout;
using std::cerr;
cout << "C++ dlopen demo\n\n";
// open the library
cout << "Opening hello.so...\n";
void* handle = dlopen("<<PATH_TO_.SO>>", RTLD_NOW);