def test_cleanup_everything(self): analyzer = analysis.Stocks() os.system('touch report.pdf') self.assertIsNone(analyzer.clean()) ok_(os.path.exists('report.pdf')) self.assertIsNone(analyzer.clean(everything=True)) ok_(not os.path.exists('report.pdf'))
def __init__(self, targets): Mailgun.__init__(self, 'intuition.io') self.targets = targets self._last_send = time.time() self.generator = analysis.Stocks() log.info('Mail report ready', recipients=targets) self.template_env = jinja2.Environment( loader=jinja2.FileSystemLoader(self._asset_dir))
def test_cleanup_garbage(self): analyzer = analysis.Stocks() os.system('touch report.aux') self.assertIsNone(analyzer.clean()) ok_(not os.path.exists('report.aux'))
def test_cleanup_garbage_when_nothing(self): analyzer = analysis.Stocks() self.assertIsNone(analyzer.clean())
def test_custom_intialize(self): analyzer = analysis.Stocks(report_template='here.rnw') eq_(analyzer.report_template, 'here.rnw')
def test_default_intialize(self): analyzer = analysis.Stocks() eq_(analyzer.report_template, self.default_template_path) eq_(analyzer.report_template, os.path.expanduser(analyzer.knitr_report)) self.assertIsInstance(analyzer.r, rpy2.robjects.R)