def test_file(self): # Test bootstrap(self.path, self.archive_path) self.assertEqual( sorted(fileList(self.path, relative=True)), sorted(fileList(self.skeleton_path, relative=True)) )
def setUp(self): self.test_dir = tempfile.mkdtemp() self.path = os.path.join(self.test_dir, 'test') self.clear_django_settings() bootstrap(self.path, os.path.join("cactus", "tests", "data", "skeleton"))
def test_file(self): # Test bootstrap(self.path, self.archive_path) self.assertEqual( sorted(fileList(self.path, relative=True)), sorted(fileList(self.skeleton_path, relative=True)), )
def test_url(self): archive_path = self.archive_path server_address = ("127.0.0.1", 7777) httpd = HTTPServer(server_address, ArchiveServerHandlerFactory(archive_path)) t = threading.Thread(target=httpd.serve_forever) t.start() bootstrap(self.path, "http://127.0.0.1:7777") httpd.shutdown() self.assertEqual( sorted(fileList(self.path, relative=True)), sorted(fileList(self.skeleton_path, relative=True)) )
def create(path, skeleton=None): """ Creates a new project at the given path. :param path: The path where the new project should be created :param skeleton: An (optional) skeleton to use to create the project. This could be a zip, tar archive (file path or URL) """ if os.path.exists(path): if raw_input("Path %s exists, move aside (y/n): " % path) == "y": os.rename(path, "%s.%s.moved" % (path, int(time.time()))) else: sys.exit() bootstrap(path, skeleton)
def create(path, skeleton=None): """ Creates a new project at the given path. :param path: The path where the new project should be created :param skeleton: An (optional) skeleton to use to create the project. This could be a zip, tar archive (file path or URL) """ if os.path.exists(path): if raw_input('Path %s exists, move aside (y/n): ' % path) == 'y': os.rename(path, '%s.%s.moved' % (path, int(time.time()))) else: sys.exit() bootstrap(path, skeleton)
def test_url(self): archive_path = self.archive_path port = random.choice(xrange(7000, 10000)) server_address = ("127.0.0.1", port) httpd = BaseHTTPServer.HTTPServer(server_address, ArchiveServerHandlerFactory(archive_path)) t = threading.Thread(target=httpd.serve_forever) t.start() bootstrap(self.path, "http://127.0.0.1:%s" % port) httpd.shutdown() self.assertEqual( sorted(fileList(self.path, relative=True)), sorted(fileList(self.skeleton_path, relative=True)) )
def test_url(self): archive_path = self.archive_path port = random.choice(xrange(7000, 10000)) server_address = ("127.0.0.1", port) httpd = BaseHTTPServer.HTTPServer(server_address, ArchiveServerHandlerFactory(archive_path)) t = threading.Thread(target=httpd.serve_forever) t.start() bootstrap(self.path, "http://127.0.0.1:%s" % port) httpd.shutdown() self.assertEqual( sorted(fileList(self.path, relative=True)), sorted(fileList(self.skeleton_path, relative=True)), )
def setUp(self): self.test_dir = tempfile.mkdtemp() self.path = os.path.join(self.test_dir, 'test') self.clear_django_settings() bootstrap(self.path)
def setUp(self): super(BaseBootstrappedTestCase, self).setUp() bootstrap(self.path, os.path.join("cactus", "tests", "data", "skeleton"))
def setUp(self): self.test_dir = tempfile.mkdtemp() self.path = os.path.join(self.test_dir, "test") self.clear_django_settings() bootstrap(self.path)