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
""" | |
Description: Import DOGnzb watchlist into CouchPotato | |
Author: Craig Palermo | |
Date: 1/14/2017 | |
""" | |
import argparse | |
import json | |
import logging | |
import sys |
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
const request = require('request'); | |
// request doesn't return a Promise, so it needs to be wrapped in a function | |
// that does for this example | |
function getRequest(url, qs = {}) { | |
return new Promise((resolve) => { | |
request | |
.get({ url, qs }) | |
.on('response', (response) => { | |
response.on('data', (data) => { |
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 { getName } from '../models/user'; | |
jest.mock('../models/user', {} => ({ | |
getName: jest.fn() | |
})); | |
test('if user model is mocked', () => { | |
getName.mockReturnValue('bob') | |
expect(getName()).toEqual('bob'); |
OlderNewer