Esempio n. 1
0
 def test_site_directory_is_file(self):
     site = tempfile.mkdtemp()
     file_site = os.path.join(site, 'fake')
     argv = self._make_argv_with()
     argv.append(file_site)
     with self.assertRaises(SystemExit):
         entry.main(argv)
Esempio n. 2
0
 def test_site_directory_is_file(self):
     site = tempfile.mkdtemp()
     file_site = os.path.join(site, 'fake')
     argv = self._make_argv_with()
     argv.append(file_site)
     with self.assertRaises(SystemExit):
         entry.main(argv)
Esempio n. 3
0
    def test_development_server_served(self, serve):
        site = self.factory.make_site()
        argv = self._make_argv_with(command='watch')
        argv.append(site.path)

        entry.main(argv)

        self.assertTrue(serve.called)
Esempio n. 4
0
    def test_development_server_served(self, serve):
        site = self.factory.make_site()
        argv = self._make_argv_with(command='watch')
        argv.append(site.path)

        entry.main(argv)

        self.assertTrue(serve.called)
Esempio n. 5
0
 def test_complete_site_generation(self, finish):
     site = self.factory.make_site()
     argv = self._make_argv_with()
     argv.append(site.path)
     entry.main(argv)
     self.assertTrue(finish.called)
Esempio n. 6
0
 def test_debug_sets_logging(self):
     logger.setLevel(logging.CRITICAL)
     argv = self._make_argv_with('-d')
     with self.assertRaises(SystemExit):
         entry.main(argv)
     self.assertEqual(logging.DEBUG, logger.getEffectiveLevel())
Esempio n. 7
0
 def test_complete_site_generation(self, finish):
     site = self.factory.make_site()
     argv = self._make_argv_with()
     argv.append(site.path)
     entry.main(argv)
     self.assertTrue(finish.called)
Esempio n. 8
0
 def test_debug_sets_logging(self):
     logger.setLevel(logging.CRITICAL)
     argv = self._make_argv_with('-d')
     with self.assertRaises(SystemExit):
         entry.main(argv)
     self.assertEqual(logging.DEBUG, logger.getEffectiveLevel())