示例#1
0
    def test_providers(self):
        """ Test providers command.
        """

        stdout = io.StringIO()
        App(stdout=stdout).run(['providers'])
        stdout.seek(0)
        self.assertEqual(stdout.read(), 'AccuWeather: accu\nRP5: rp5\n')
示例#2
0
    def test_providers(self):
        """Test providers command."""

        sys.stdout = io.StringIO()
        App(stdout=sys.stdout).run(['providers'])
        sys.stdout.seek(0)
        self.assertEqual(
            sys.stdout.read(),
            'AccuWeather (accu)\nRP5 (rp5)\nSINOPTIK (sinoptik)\n')
示例#3
0
    def test_providers(self):
        """ Test providers command.
		"""

        stdout = io.StringIO()
        App(stdout=stdout).run(['providers'])
        stdout.seek(0)

        self.assertEqual(stdout.read(), ('All available providers:\nsinoptik'
                                         ' \naccu \nrp5 \n'))
示例#4
0
    def test_clear_cache_dir(self):
        """ Test clear_cache_dir command.
	    """

        cache = '.wappcache'
        cache_dir = Path.home() / cache
        if not cache_dir.exists():
            os.makedirs(cache_dir)

        stdout = io.StringIO()
        App(stdout=stdout).run(['clear_cache'])
        stdout.seek(0)

        self.assertEqual(stdout.read(), 'Clear all cache files. \n')
示例#5
0
 def setUp(self):
     self.test_app = App()