Ejemplo n.º 1
0
 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'))
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
 def test_cleanup_garbage(self):
     analyzer = analysis.Stocks()
     os.system('touch report.aux')
     self.assertIsNone(analyzer.clean())
     ok_(not os.path.exists('report.aux'))
Ejemplo n.º 4
0
 def test_cleanup_garbage_when_nothing(self):
     analyzer = analysis.Stocks()
     self.assertIsNone(analyzer.clean())
Ejemplo n.º 5
0
 def test_custom_intialize(self):
     analyzer = analysis.Stocks(report_template='here.rnw')
     eq_(analyzer.report_template, 'here.rnw')
Ejemplo n.º 6
0
 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)