Exemplo n.º 1
0
    def test_read_config(self):
        conf_settings = afl_stats.read_config('testdata/afl-stats.conf.test')

        self.assertDictEqual(conf_settings, test_conf_settings)

        with self.assertRaises(SystemExit):
            afl_stats.read_config('/config-file-not-found')
        with self.assertRaises(json.decoder.JSONDecodeError):
            afl_stats.read_config('testdata/afl-stats.conf.invalid02.test')
Exemplo n.º 2
0
    def test_read_config(self):
        conf_settings = afl_stats.read_config('testdata/afl-stats.conf.test')

        self.assertDictEqual(conf_settings, test_conf_settings)

        with self.assertRaises(SystemExit):
            afl_stats.read_config('/config-file-not-found')
        with self.assertRaises(json.decoder.JSONDecodeError):
            afl_stats.read_config('testdata/afl-stats.conf.invalid02.test')
Exemplo n.º 3
0
    def test_fetch_stats(self):
        config_settings = afl_stats.read_config('testdata/afl-stats.conf.test')
        twitter_inst = None

        self.assertIsNone(afl_stats.fetch_stats(config_settings, twitter_inst))
        # os.remove('.afl_stats.sync')
        self.assertIsNone(afl_stats.fetch_stats(config_settings, twitter_inst))
Exemplo n.º 4
0
    def test_fetch_stats(self):
        config_settings = afl_stats.read_config('testdata/afl-stats.conf.test')
        twitter_inst = None

        self.assertIsNone(afl_stats.fetch_stats(config_settings, twitter_inst))
        #os.remove('.afl_stats.sync')
        self.assertIsNone(afl_stats.fetch_stats(config_settings, twitter_inst))
Exemplo n.º 5
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')
Exemplo n.º 6
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))
Exemplo n.º 7
0
    def test_read_config(self):
        conf_settings = afl_stats.read_config('testdata/afl-stats.conf.test')

        self.assertDictEqual(conf_settings, test_conf_settings)