def setUpClass(cls): """Create an actual sandbox. This depends on a properly set up docker environment. """ utils.build_from_directory(os.path.dirname(devappserver_init.__file__), APPSTART_BASE_IMAGE, nocache=True) test_directory = os.path.dirname(os.path.realpath(__file__)) cls.conf_file = os.path.join(test_directory, 'app.yaml') # Use temporary storage, generating unique name with a timestamp. temp_storage_path = '/tmp/storage/%s' % str(time.time()) cls.sandbox = container_sandbox.ContainerSandbox( cls.conf_file, storage_path=temp_storage_path, devbase_image=APPSTART_BASE_IMAGE, force_version=True) # Set up the containers cls.sandbox.start()
def setUpClass(cls): """Create an actual sandbox. This depends on a properly set up docker environment. """ utils.build_from_directory(os.path.dirname(devappserver_init.__file__), APPSTART_BASE_IMAGE, nocache=True) test_directory = os.path.dirname(os.path.realpath(__file__)) cls.conf_file = os.path.join(test_directory, 'app.yaml') # Use temporary storage, generating unique name with a timestamp. temp_storage_path = '/tmp/storage/%s' % str(time.time()) cls.sandbox = container_sandbox.ContainerSandbox( cls.conf_file, storage_path=temp_storage_path, devbase_image=APPSTART_BASE_IMAGE, force_version=True, extra_ports={1000: 1111}) # Set up the containers cls.sandbox.start()
def test_build_from_directory(self): utils.build_from_directory(APP_DIR, 'test') self.assertEqual(len(fake_docker.images), 1 + len(fake_docker.DEFAULT_IMAGES)) self.assertIn('test', fake_docker.images)