Example #1
0
    def test_read_config(self):
        afl_stats.init_config()
        conf_settings = afl_stats.read_config('testdata/afl-stats.conf.test')

        self.assertDictEqual(conf_settings, test_conf_settings)

        with self.assertRaises(SystemExit):
            afl_stats.init_config()
            afl_stats.read_config('/config-file-not-found')
        with self.assertRaises(SystemExit):
            afl_stats.init_config()
            afl_stats.read_config('testdata/afl-stats.conf.invalid00.test')
        with self.assertRaises(SystemExit):
            afl_stats.init_config()
            afl_stats.read_config('testdata/afl-stats.conf.invalid01.test')
        with self.assertRaises(SystemExit):
            afl_stats.init_config()
            afl_stats.read_config('testdata/afl-stats.conf.invalid02.test')
Example #2
0
 def test_main(self):
     afl_stats.init_config()
     with self.assertRaises(SystemExit):
         afl_stats.main(['afl-stats', '--config', './testdata/afl-stats.conf.test'])
Example #3
0
    def test_fetch_stats(self):
        afl_stats.init_config()
        config_settings = afl_stats.read_config('testdata/afl-stats.conf.test')
        twitter_inst = None

        self.assertIsNone(afl_stats.fetch_stats(config_settings, twitter_inst))