How to use supported method in mountebank

Best JavaScript code snippet using mountebank

_vmware_host_capability_facts.py

Source:_vmware_host_capability_facts.py Github

copy

Full Screen

1#!/usr/bin/python2# -*- coding: utf-8 -*-3# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>4# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)5from __future__ import absolute_import, division, print_function6__metaclass__ = type7ANSIBLE_METADATA = {8 'metadata_version': '1.1',9 'status': ['deprecated'],10 'supported_by': 'community'11}12DOCUMENTATION = r'''13---14module: vmware_host_capability_facts15deprecated:16 removed_in: '2.13'17 why: Deprecated in favour of C(_info) module.18 alternative: Use M(vmware_host_capability_info) instead.19short_description: Gathers facts about an ESXi host's capability information20description:21- This module can be used to gather facts about an ESXi host's capability information when ESXi hostname or Cluster name is given.22version_added: 2.623author:24- Abhijeet Kasurde (@Akasurde)25notes:26- Tested on vSphere 6.527requirements:28- python >= 2.629- PyVmomi30options:31 cluster_name:32 description:33 - Name of the cluster from all host systems to be used for facts gathering.34 - If C(esxi_hostname) is not given, this parameter is required.35 type: str36 esxi_hostname:37 description:38 - ESXi hostname to gather facts from.39 - If C(cluster_name) is not given, this parameter is required.40 type: str41extends_documentation_fragment: vmware.documentation42'''43EXAMPLES = r'''44- name: Gather capability facts about all ESXi Host in given Cluster45 vmware_host_capability_facts:46 hostname: '{{ vcenter_hostname }}'47 username: '{{ vcenter_username }}'48 password: '{{ vcenter_password }}'49 cluster_name: cluster_name50 delegate_to: localhost51 register: all_cluster_hosts_facts52- name: Gather capability facts about ESXi Host53 vmware_host_capability_facts:54 hostname: '{{ vcenter_hostname }}'55 username: '{{ vcenter_username }}'56 password: '{{ vcenter_password }}'57 esxi_hostname: '{{ esxi_hostname }}'58 delegate_to: localhost59 register: hosts_facts60'''61RETURN = r'''62hosts_capability_facts:63 description: metadata about host's capability information64 returned: always65 type: dict66 sample: {67 "esxi_hostname_0001": {68 "accel3dSupported": false,69 "backgroundSnapshotsSupported": false,70 "checkpointFtCompatibilityIssues": [],71 "checkpointFtSupported": false,72 "cloneFromSnapshotSupported": true,73 "cpuHwMmuSupported": true,74 }75 }76'''77from ansible.module_utils.basic import AnsibleModule78from ansible.module_utils.vmware import vmware_argument_spec, PyVmomi79class CapabilityFactsManager(PyVmomi):80 def __init__(self, module):81 super(CapabilityFactsManager, self).__init__(module)82 cluster_name = self.params.get('cluster_name', None)83 esxi_host_name = self.params.get('esxi_hostname', None)84 self.hosts = self.get_all_host_objs(cluster_name=cluster_name, esxi_host_name=esxi_host_name)85 def gather_host_capability_facts(self):86 hosts_capability_facts = dict()87 for host in self.hosts:88 hc = host.capability89 hosts_capability_facts[host.name] = dict(90 recursiveResourcePoolsSupported=hc.recursiveResourcePoolsSupported,91 cpuMemoryResourceConfigurationSupported=hc.cpuMemoryResourceConfigurationSupported,92 rebootSupported=hc.rebootSupported,93 shutdownSupported=hc.shutdownSupported,94 vmotionSupported=hc.vmotionSupported,95 standbySupported=hc.standbySupported,96 ipmiSupported=hc.ipmiSupported,97 maxSupportedVMs=hc.maxSupportedVMs,98 maxRunningVMs=hc.maxRunningVMs,99 maxSupportedVcpus=hc.maxSupportedVcpus,100 maxRegisteredVMs=hc.maxRegisteredVMs,101 datastorePrincipalSupported=hc.datastorePrincipalSupported,102 sanSupported=hc.sanSupported,103 nfsSupported=hc.nfsSupported,104 iscsiSupported=hc.iscsiSupported,105 vlanTaggingSupported=hc.vlanTaggingSupported,106 nicTeamingSupported=hc.nicTeamingSupported,107 highGuestMemSupported=hc.highGuestMemSupported,108 maintenanceModeSupported=hc.maintenanceModeSupported,109 suspendedRelocateSupported=hc.suspendedRelocateSupported,110 restrictedSnapshotRelocateSupported=hc.restrictedSnapshotRelocateSupported,111 perVmSwapFiles=hc.perVmSwapFiles,112 localSwapDatastoreSupported=hc.localSwapDatastoreSupported,113 unsharedSwapVMotionSupported=hc.unsharedSwapVMotionSupported,114 backgroundSnapshotsSupported=hc.backgroundSnapshotsSupported,115 preAssignedPCIUnitNumbersSupported=hc.preAssignedPCIUnitNumbersSupported,116 screenshotSupported=hc.screenshotSupported,117 scaledScreenshotSupported=hc.scaledScreenshotSupported,118 storageVMotionSupported=hc.storageVMotionSupported,119 vmotionWithStorageVMotionSupported=hc.vmotionWithStorageVMotionSupported,120 vmotionAcrossNetworkSupported=hc.vmotionAcrossNetworkSupported,121 maxNumDisksSVMotion=hc.maxNumDisksSVMotion,122 hbrNicSelectionSupported=hc.hbrNicSelectionSupported,123 vrNfcNicSelectionSupported=hc.vrNfcNicSelectionSupported,124 recordReplaySupported=hc.recordReplaySupported,125 ftSupported=hc.ftSupported,126 replayUnsupportedReason=hc.replayUnsupportedReason,127 checkpointFtSupported=hc.checkpointFtSupported,128 smpFtSupported=hc.smpFtSupported,129 maxVcpusPerFtVm=hc.maxVcpusPerFtVm,130 loginBySSLThumbprintSupported=hc.loginBySSLThumbprintSupported,131 cloneFromSnapshotSupported=hc.cloneFromSnapshotSupported,132 deltaDiskBackingsSupported=hc.deltaDiskBackingsSupported,133 perVMNetworkTrafficShapingSupported=hc.perVMNetworkTrafficShapingSupported,134 tpmSupported=hc.tpmSupported,135 virtualExecUsageSupported=hc.virtualExecUsageSupported,136 storageIORMSupported=hc.storageIORMSupported,137 vmDirectPathGen2Supported=hc.vmDirectPathGen2Supported,138 vmDirectPathGen2UnsupportedReasonExtended=hc.vmDirectPathGen2UnsupportedReasonExtended,139 vStorageCapable=hc.vStorageCapable,140 snapshotRelayoutSupported=hc.snapshotRelayoutSupported,141 firewallIpRulesSupported=hc.firewallIpRulesSupported,142 servicePackageInfoSupported=hc.servicePackageInfoSupported,143 maxHostRunningVms=hc.maxHostRunningVms,144 maxHostSupportedVcpus=hc.maxHostSupportedVcpus,145 vmfsDatastoreMountCapable=hc.vmfsDatastoreMountCapable,146 eightPlusHostVmfsSharedAccessSupported=hc.eightPlusHostVmfsSharedAccessSupported,147 nestedHVSupported=hc.nestedHVSupported,148 vPMCSupported=hc.vPMCSupported,149 interVMCommunicationThroughVMCISupported=hc.interVMCommunicationThroughVMCISupported,150 scheduledHardwareUpgradeSupported=hc.scheduledHardwareUpgradeSupported,151 featureCapabilitiesSupported=hc.featureCapabilitiesSupported,152 latencySensitivitySupported=hc.latencySensitivitySupported,153 storagePolicySupported=hc.storagePolicySupported,154 accel3dSupported=hc.accel3dSupported,155 reliableMemoryAware=hc.reliableMemoryAware,156 multipleNetworkStackInstanceSupported=hc.multipleNetworkStackInstanceSupported,157 messageBusProxySupported=hc.messageBusProxySupported,158 vsanSupported=hc.vsanSupported,159 vFlashSupported=hc.vFlashSupported,160 hostAccessManagerSupported=hc.hostAccessManagerSupported,161 provisioningNicSelectionSupported=hc.provisioningNicSelectionSupported,162 nfs41Supported=hc.nfs41Supported,163 nfs41Krb5iSupported=hc.nfs41Krb5iSupported,164 turnDiskLocatorLedSupported=hc.turnDiskLocatorLedSupported,165 virtualVolumeDatastoreSupported=hc.virtualVolumeDatastoreSupported,166 markAsSsdSupported=hc.markAsSsdSupported,167 markAsLocalSupported=hc.markAsLocalSupported,168 smartCardAuthenticationSupported=hc.smartCardAuthenticationSupported,169 cryptoSupported=hc.cryptoSupported,170 oneKVolumeAPIsSupported=hc.oneKVolumeAPIsSupported,171 gatewayOnNicSupported=hc.gatewayOnNicSupported,172 upitSupported=hc.upitSupported,173 cpuHwMmuSupported=hc.cpuHwMmuSupported,174 encryptedVMotionSupported=hc.encryptedVMotionSupported,175 encryptionChangeOnAddRemoveSupported=hc.encryptionChangeOnAddRemoveSupported,176 encryptionHotOperationSupported=hc.encryptionHotOperationSupported,177 encryptionWithSnapshotsSupported=hc.encryptionWithSnapshotsSupported,178 encryptionFaultToleranceSupported=hc.encryptionFaultToleranceSupported,179 encryptionMemorySaveSupported=hc.encryptionMemorySaveSupported,180 encryptionRDMSupported=hc.encryptionRDMSupported,181 encryptionVFlashSupported=hc.encryptionVFlashSupported,182 encryptionCBRCSupported=hc.encryptionCBRCSupported,183 encryptionHBRSupported=hc.encryptionHBRSupported,184 supportedVmfsMajorVersion=[version for version in hc.supportedVmfsMajorVersion],185 vmDirectPathGen2UnsupportedReason=[reason for reason in hc.vmDirectPathGen2UnsupportedReason],186 ftCompatibilityIssues=[issue for issue in hc.ftCompatibilityIssues],187 checkpointFtCompatibilityIssues=[issue for issue in hc.checkpointFtCompatibilityIssues],188 smpFtCompatibilityIssues=[issue for issue in hc.smpFtCompatibilityIssues],189 replayCompatibilityIssues=[issue for issue in hc.replayCompatibilityIssues],190 )191 return hosts_capability_facts192def main():193 argument_spec = vmware_argument_spec()194 argument_spec.update(195 cluster_name=dict(type='str', required=False),196 esxi_hostname=dict(type='str', required=False),197 )198 module = AnsibleModule(199 argument_spec=argument_spec,200 required_one_of=[201 ['cluster_name', 'esxi_hostname'],202 ],203 supports_check_mode=True,204 )205 host_capability_manager = CapabilityFactsManager(module)206 module.exit_json(changed=False,207 hosts_capability_facts=host_capability_manager.gather_host_capability_facts())208if __name__ == "__main__":...

Full Screen

Full Screen

vmware_host_capability_info.py

Source:vmware_host_capability_info.py Github

copy

Full Screen

1#!/usr/bin/python2# -*- coding: utf-8 -*-3# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>4# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)5from __future__ import absolute_import, division, print_function6__metaclass__ = type7ANSIBLE_METADATA = {8 'metadata_version': '1.1',9 'status': ['preview'],10 'supported_by': 'community'11}12DOCUMENTATION = r'''13---14module: vmware_host_capability_info15short_description: Gathers info about an ESXi host's capability information16description:17- This module can be used to gather information about an ESXi host's capability information when ESXi hostname or Cluster name is given.18version_added: '2.9'19author:20- Abhijeet Kasurde (@Akasurde)21notes:22- Tested on vSphere 6.523requirements:24- python >= 2.625- PyVmomi26options:27 cluster_name:28 description:29 - Name of the cluster from all host systems to be used for information gathering.30 - If C(esxi_hostname) is not given, this parameter is required.31 type: str32 esxi_hostname:33 description:34 - ESXi hostname to gather information from.35 - If C(cluster_name) is not given, this parameter is required.36 type: str37extends_documentation_fragment: vmware.documentation38'''39EXAMPLES = r'''40- name: Gather capability info about all ESXi Host in given Cluster41 vmware_host_capability_info:42 hostname: '{{ vcenter_hostname }}'43 username: '{{ vcenter_username }}'44 password: '{{ vcenter_password }}'45 cluster_name: cluster_name46 delegate_to: localhost47 register: all_cluster_hosts_info48- name: Gather capability info about ESXi Host49 vmware_host_capability_info:50 hostname: '{{ vcenter_hostname }}'51 username: '{{ vcenter_username }}'52 password: '{{ vcenter_password }}'53 esxi_hostname: '{{ esxi_hostname }}'54 delegate_to: localhost55 register: hosts_info56'''57RETURN = r'''58hosts_capability_info:59 description: metadata about host's capability info60 returned: always61 type: dict62 sample: {63 "esxi_hostname_0001": {64 "accel3dSupported": false,65 "backgroundSnapshotsSupported": false,66 "checkpointFtCompatibilityIssues": [],67 "checkpointFtSupported": false,68 "cloneFromSnapshotSupported": true,69 "cpuHwMmuSupported": true,70 }71 }72'''73from ansible.module_utils.basic import AnsibleModule74from ansible.module_utils.vmware import vmware_argument_spec, PyVmomi75class CapabilityInfoManager(PyVmomi):76 def __init__(self, module):77 super(CapabilityInfoManager, self).__init__(module)78 cluster_name = self.params.get('cluster_name', None)79 esxi_host_name = self.params.get('esxi_hostname', None)80 self.hosts = self.get_all_host_objs(cluster_name=cluster_name, esxi_host_name=esxi_host_name)81 def gather_host_capability_info(self):82 hosts_capability_info = dict()83 for host in self.hosts:84 hc = host.capability85 hosts_capability_info[host.name] = dict(86 recursiveResourcePoolsSupported=hc.recursiveResourcePoolsSupported,87 cpuMemoryResourceConfigurationSupported=hc.cpuMemoryResourceConfigurationSupported,88 rebootSupported=hc.rebootSupported,89 shutdownSupported=hc.shutdownSupported,90 vmotionSupported=hc.vmotionSupported,91 standbySupported=hc.standbySupported,92 ipmiSupported=hc.ipmiSupported,93 maxSupportedVMs=hc.maxSupportedVMs,94 maxRunningVMs=hc.maxRunningVMs,95 maxSupportedVcpus=hc.maxSupportedVcpus,96 maxRegisteredVMs=hc.maxRegisteredVMs,97 datastorePrincipalSupported=hc.datastorePrincipalSupported,98 sanSupported=hc.sanSupported,99 nfsSupported=hc.nfsSupported,100 iscsiSupported=hc.iscsiSupported,101 vlanTaggingSupported=hc.vlanTaggingSupported,102 nicTeamingSupported=hc.nicTeamingSupported,103 highGuestMemSupported=hc.highGuestMemSupported,104 maintenanceModeSupported=hc.maintenanceModeSupported,105 suspendedRelocateSupported=hc.suspendedRelocateSupported,106 restrictedSnapshotRelocateSupported=hc.restrictedSnapshotRelocateSupported,107 perVmSwapFiles=hc.perVmSwapFiles,108 localSwapDatastoreSupported=hc.localSwapDatastoreSupported,109 unsharedSwapVMotionSupported=hc.unsharedSwapVMotionSupported,110 backgroundSnapshotsSupported=hc.backgroundSnapshotsSupported,111 preAssignedPCIUnitNumbersSupported=hc.preAssignedPCIUnitNumbersSupported,112 screenshotSupported=hc.screenshotSupported,113 scaledScreenshotSupported=hc.scaledScreenshotSupported,114 storageVMotionSupported=hc.storageVMotionSupported,115 vmotionWithStorageVMotionSupported=hc.vmotionWithStorageVMotionSupported,116 vmotionAcrossNetworkSupported=hc.vmotionAcrossNetworkSupported,117 maxNumDisksSVMotion=hc.maxNumDisksSVMotion,118 hbrNicSelectionSupported=hc.hbrNicSelectionSupported,119 vrNfcNicSelectionSupported=hc.vrNfcNicSelectionSupported,120 recordReplaySupported=hc.recordReplaySupported,121 ftSupported=hc.ftSupported,122 replayUnsupportedReason=hc.replayUnsupportedReason,123 checkpointFtSupported=hc.checkpointFtSupported,124 smpFtSupported=hc.smpFtSupported,125 maxVcpusPerFtVm=hc.maxVcpusPerFtVm,126 loginBySSLThumbprintSupported=hc.loginBySSLThumbprintSupported,127 cloneFromSnapshotSupported=hc.cloneFromSnapshotSupported,128 deltaDiskBackingsSupported=hc.deltaDiskBackingsSupported,129 perVMNetworkTrafficShapingSupported=hc.perVMNetworkTrafficShapingSupported,130 tpmSupported=hc.tpmSupported,131 virtualExecUsageSupported=hc.virtualExecUsageSupported,132 storageIORMSupported=hc.storageIORMSupported,133 vmDirectPathGen2Supported=hc.vmDirectPathGen2Supported,134 vmDirectPathGen2UnsupportedReasonExtended=hc.vmDirectPathGen2UnsupportedReasonExtended,135 vStorageCapable=hc.vStorageCapable,136 snapshotRelayoutSupported=hc.snapshotRelayoutSupported,137 firewallIpRulesSupported=hc.firewallIpRulesSupported,138 servicePackageInfoSupported=hc.servicePackageInfoSupported,139 maxHostRunningVms=hc.maxHostRunningVms,140 maxHostSupportedVcpus=hc.maxHostSupportedVcpus,141 vmfsDatastoreMountCapable=hc.vmfsDatastoreMountCapable,142 eightPlusHostVmfsSharedAccessSupported=hc.eightPlusHostVmfsSharedAccessSupported,143 nestedHVSupported=hc.nestedHVSupported,144 vPMCSupported=hc.vPMCSupported,145 interVMCommunicationThroughVMCISupported=hc.interVMCommunicationThroughVMCISupported,146 scheduledHardwareUpgradeSupported=hc.scheduledHardwareUpgradeSupported,147 featureCapabilitiesSupported=hc.featureCapabilitiesSupported,148 latencySensitivitySupported=hc.latencySensitivitySupported,149 storagePolicySupported=hc.storagePolicySupported,150 accel3dSupported=hc.accel3dSupported,151 reliableMemoryAware=hc.reliableMemoryAware,152 multipleNetworkStackInstanceSupported=hc.multipleNetworkStackInstanceSupported,153 messageBusProxySupported=hc.messageBusProxySupported,154 vsanSupported=hc.vsanSupported,155 vFlashSupported=hc.vFlashSupported,156 hostAccessManagerSupported=hc.hostAccessManagerSupported,157 provisioningNicSelectionSupported=hc.provisioningNicSelectionSupported,158 nfs41Supported=hc.nfs41Supported,159 nfs41Krb5iSupported=hc.nfs41Krb5iSupported,160 turnDiskLocatorLedSupported=hc.turnDiskLocatorLedSupported,161 virtualVolumeDatastoreSupported=hc.virtualVolumeDatastoreSupported,162 markAsSsdSupported=hc.markAsSsdSupported,163 markAsLocalSupported=hc.markAsLocalSupported,164 smartCardAuthenticationSupported=hc.smartCardAuthenticationSupported,165 cryptoSupported=hc.cryptoSupported,166 oneKVolumeAPIsSupported=hc.oneKVolumeAPIsSupported,167 gatewayOnNicSupported=hc.gatewayOnNicSupported,168 upitSupported=hc.upitSupported,169 cpuHwMmuSupported=hc.cpuHwMmuSupported,170 encryptedVMotionSupported=hc.encryptedVMotionSupported,171 encryptionChangeOnAddRemoveSupported=hc.encryptionChangeOnAddRemoveSupported,172 encryptionHotOperationSupported=hc.encryptionHotOperationSupported,173 encryptionWithSnapshotsSupported=hc.encryptionWithSnapshotsSupported,174 encryptionFaultToleranceSupported=hc.encryptionFaultToleranceSupported,175 encryptionMemorySaveSupported=hc.encryptionMemorySaveSupported,176 encryptionRDMSupported=hc.encryptionRDMSupported,177 encryptionVFlashSupported=hc.encryptionVFlashSupported,178 encryptionCBRCSupported=hc.encryptionCBRCSupported,179 encryptionHBRSupported=hc.encryptionHBRSupported,180 supportedVmfsMajorVersion=[version for version in hc.supportedVmfsMajorVersion],181 vmDirectPathGen2UnsupportedReason=[reason for reason in hc.vmDirectPathGen2UnsupportedReason],182 ftCompatibilityIssues=[issue for issue in hc.ftCompatibilityIssues],183 checkpointFtCompatibilityIssues=[issue for issue in hc.checkpointFtCompatibilityIssues],184 smpFtCompatibilityIssues=[issue for issue in hc.smpFtCompatibilityIssues],185 replayCompatibilityIssues=[issue for issue in hc.replayCompatibilityIssues],186 )187 return hosts_capability_info188def main():189 argument_spec = vmware_argument_spec()190 argument_spec.update(191 cluster_name=dict(type='str', required=False),192 esxi_hostname=dict(type='str', required=False),193 )194 module = AnsibleModule(195 argument_spec=argument_spec,196 required_one_of=[197 ['cluster_name', 'esxi_hostname'],198 ],199 supports_check_mode=True,200 )201 host_capability_manager = CapabilityInfoManager(module)202 module.exit_json(changed=False,203 hosts_capability_info=host_capability_manager.gather_host_capability_info())204if __name__ == "__main__":...

Full Screen

Full Screen

libpng.py

Source:libpng.py Github

copy

Full Screen

1# Copyright 2015 The Emscripten Authors. All rights reserved.2# Emscripten is available under two separate licenses, the MIT license and the3# University of Illinois/NCSA Open Source License. Both these licenses can be4# found in the LICENSE file.5import os, shutil, logging6from . import zlib7TAG = 'version_1'8def get(ports, settings, shared):9 if settings.USE_LIBPNG == 1:10 ports.fetch_project('libpng', 'https://github.com/emscripten-ports/libpng/archive/' + TAG + '.zip', 'libpng-' + TAG)11 def create():12 logging.info('building port: libpng')13 source_path = os.path.join(ports.get_dir(), 'libpng', 'libpng-' + TAG)14 dest_path = os.path.join(shared.Cache.get_path('ports-builds'), 'libpng')15 shutil.rmtree(dest_path, ignore_errors=True)16 shutil.copytree(source_path, dest_path)17 open(os.path.join(dest_path, 'pnglibconf.h'), 'w').write(pnglibconf_h)18 final = os.path.join(ports.get_build_dir(), 'libpng', 'libpng.bc')19 ports.build_port(dest_path, final, flags=['-s', 'USE_ZLIB=1'], exclude_files=['pngtest'], exclude_dirs=['scripts', 'contrib'])20 return final21 return [shared.Cache.get('libpng', create, what='port')]22 else:23 return []24def process_dependencies(settings):25 if settings.USE_LIBPNG == 1:26 settings.USE_ZLIB = 127def process_args(ports, args, settings, shared):28 if settings.USE_LIBPNG == 1:29 get(ports, settings, shared)30 args += ['-Xclang', '-isystem' + os.path.join(shared.Cache.get_path('ports-builds'), 'libpng')]31 return args32def show():33 return 'libpng (USE_LIBPNG=1; zlib license)'34pnglibconf_h = r'''/* libpng 1.6.17 STANDARD API DEFINITION */35/* pnglibconf.h - library build configuration */36/* Libpng version 1.6.17 - March 26, 2015 */37/* Copyright (c) 1998-2014 Glenn Randers-Pehrson */38/* This code is released under the libpng license. */39/* For conditions of distribution and use, see the disclaimer */40/* and license in png.h */41/* pnglibconf.h */42/* Machine generated file: DO NOT EDIT */43/* Derived from: scripts/pnglibconf.dfa */44#ifndef PNGLCONF_H45#define PNGLCONF_H46/* options */47#define PNG_16BIT_SUPPORTED48#define PNG_ALIGNED_MEMORY_SUPPORTED49/*#undef PNG_ARM_NEON_API_SUPPORTED*/50/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/51#define PNG_BENIGN_ERRORS_SUPPORTED52#define PNG_BENIGN_READ_ERRORS_SUPPORTED53/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/54#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED55#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED56#define PNG_COLORSPACE_SUPPORTED57#define PNG_CONSOLE_IO_SUPPORTED58#define PNG_CONVERT_tIME_SUPPORTED59#define PNG_EASY_ACCESS_SUPPORTED60/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/61#define PNG_ERROR_TEXT_SUPPORTED62#define PNG_FIXED_POINT_SUPPORTED63#define PNG_FLOATING_ARITHMETIC_SUPPORTED64#define PNG_FLOATING_POINT_SUPPORTED65#define PNG_FORMAT_AFIRST_SUPPORTED66#define PNG_FORMAT_BGR_SUPPORTED67#define PNG_GAMMA_SUPPORTED68#define PNG_GET_PALETTE_MAX_SUPPORTED69#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED70#define PNG_INCH_CONVERSIONS_SUPPORTED71#define PNG_INFO_IMAGE_SUPPORTED72#define PNG_IO_STATE_SUPPORTED73#define PNG_MNG_FEATURES_SUPPORTED74#define PNG_POINTER_INDEXING_SUPPORTED75#define PNG_PROGRESSIVE_READ_SUPPORTED76#define PNG_READ_16BIT_SUPPORTED77#define PNG_READ_ALPHA_MODE_SUPPORTED78#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED79#define PNG_READ_BACKGROUND_SUPPORTED80#define PNG_READ_BGR_SUPPORTED81#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED82#define PNG_READ_COMPOSITE_NODIV_SUPPORTED83#define PNG_READ_COMPRESSED_TEXT_SUPPORTED84#define PNG_READ_EXPAND_16_SUPPORTED85#define PNG_READ_EXPAND_SUPPORTED86#define PNG_READ_FILLER_SUPPORTED87#define PNG_READ_GAMMA_SUPPORTED88#define PNG_READ_GET_PALETTE_MAX_SUPPORTED89#define PNG_READ_GRAY_TO_RGB_SUPPORTED90#define PNG_READ_INTERLACING_SUPPORTED91#define PNG_READ_INT_FUNCTIONS_SUPPORTED92#define PNG_READ_INVERT_ALPHA_SUPPORTED93#define PNG_READ_INVERT_SUPPORTED94#define PNG_READ_OPT_PLTE_SUPPORTED95#define PNG_READ_PACKSWAP_SUPPORTED96#define PNG_READ_PACK_SUPPORTED97#define PNG_READ_QUANTIZE_SUPPORTED98#define PNG_READ_RGB_TO_GRAY_SUPPORTED99#define PNG_READ_SCALE_16_TO_8_SUPPORTED100#define PNG_READ_SHIFT_SUPPORTED101#define PNG_READ_STRIP_16_TO_8_SUPPORTED102#define PNG_READ_STRIP_ALPHA_SUPPORTED103#define PNG_READ_SUPPORTED104#define PNG_READ_SWAP_ALPHA_SUPPORTED105#define PNG_READ_SWAP_SUPPORTED106#define PNG_READ_TEXT_SUPPORTED107#define PNG_READ_TRANSFORMS_SUPPORTED108#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED109#define PNG_READ_USER_CHUNKS_SUPPORTED110#define PNG_READ_USER_TRANSFORM_SUPPORTED111#define PNG_READ_bKGD_SUPPORTED112#define PNG_READ_cHRM_SUPPORTED113#define PNG_READ_gAMA_SUPPORTED114#define PNG_READ_hIST_SUPPORTED115#define PNG_READ_iCCP_SUPPORTED116#define PNG_READ_iTXt_SUPPORTED117#define PNG_READ_oFFs_SUPPORTED118#define PNG_READ_pCAL_SUPPORTED119#define PNG_READ_pHYs_SUPPORTED120#define PNG_READ_sBIT_SUPPORTED121#define PNG_READ_sCAL_SUPPORTED122#define PNG_READ_sPLT_SUPPORTED123#define PNG_READ_sRGB_SUPPORTED124#define PNG_READ_tEXt_SUPPORTED125#define PNG_READ_tIME_SUPPORTED126#define PNG_READ_tRNS_SUPPORTED127#define PNG_READ_zTXt_SUPPORTED128#define PNG_SAVE_INT_32_SUPPORTED129#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED130#define PNG_SEQUENTIAL_READ_SUPPORTED131#define PNG_SETJMP_SUPPORTED132#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED133#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED134#define PNG_SET_OPTION_SUPPORTED135#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED136#define PNG_SET_USER_LIMITS_SUPPORTED137#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED138#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED139#define PNG_SIMPLIFIED_READ_SUPPORTED140#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED141#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED142#define PNG_SIMPLIFIED_WRITE_SUPPORTED143#define PNG_STDIO_SUPPORTED144#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED145#define PNG_TEXT_SUPPORTED146#define PNG_TIME_RFC1123_SUPPORTED147#define PNG_UNKNOWN_CHUNKS_SUPPORTED148#define PNG_USER_CHUNKS_SUPPORTED149#define PNG_USER_LIMITS_SUPPORTED150#define PNG_USER_MEM_SUPPORTED151#define PNG_USER_TRANSFORM_INFO_SUPPORTED152#define PNG_USER_TRANSFORM_PTR_SUPPORTED153#define PNG_WARNINGS_SUPPORTED154#define PNG_WRITE_16BIT_SUPPORTED155#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED156#define PNG_WRITE_BGR_SUPPORTED157#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED158#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED159#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED160#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED161#define PNG_WRITE_FILLER_SUPPORTED162#define PNG_WRITE_FILTER_SUPPORTED163#define PNG_WRITE_FLUSH_SUPPORTED164#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED165#define PNG_WRITE_INTERLACING_SUPPORTED166#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED167#define PNG_WRITE_INVERT_ALPHA_SUPPORTED168#define PNG_WRITE_INVERT_SUPPORTED169#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED170#define PNG_WRITE_PACKSWAP_SUPPORTED171#define PNG_WRITE_PACK_SUPPORTED172#define PNG_WRITE_SHIFT_SUPPORTED173#define PNG_WRITE_SUPPORTED174#define PNG_WRITE_SWAP_ALPHA_SUPPORTED175#define PNG_WRITE_SWAP_SUPPORTED176#define PNG_WRITE_TEXT_SUPPORTED177#define PNG_WRITE_TRANSFORMS_SUPPORTED178#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED179#define PNG_WRITE_USER_TRANSFORM_SUPPORTED180#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED181#define PNG_WRITE_bKGD_SUPPORTED182#define PNG_WRITE_cHRM_SUPPORTED183#define PNG_WRITE_gAMA_SUPPORTED184#define PNG_WRITE_hIST_SUPPORTED185#define PNG_WRITE_iCCP_SUPPORTED186#define PNG_WRITE_iTXt_SUPPORTED187#define PNG_WRITE_oFFs_SUPPORTED188#define PNG_WRITE_pCAL_SUPPORTED189#define PNG_WRITE_pHYs_SUPPORTED190#define PNG_WRITE_sBIT_SUPPORTED191#define PNG_WRITE_sCAL_SUPPORTED192#define PNG_WRITE_sPLT_SUPPORTED193#define PNG_WRITE_sRGB_SUPPORTED194#define PNG_WRITE_tEXt_SUPPORTED195#define PNG_WRITE_tIME_SUPPORTED196#define PNG_WRITE_tRNS_SUPPORTED197#define PNG_WRITE_zTXt_SUPPORTED198#define PNG_bKGD_SUPPORTED199#define PNG_cHRM_SUPPORTED200#define PNG_gAMA_SUPPORTED201#define PNG_hIST_SUPPORTED202#define PNG_iCCP_SUPPORTED203#define PNG_iTXt_SUPPORTED204#define PNG_oFFs_SUPPORTED205#define PNG_pCAL_SUPPORTED206#define PNG_pHYs_SUPPORTED207#define PNG_sBIT_SUPPORTED208#define PNG_sCAL_SUPPORTED209#define PNG_sPLT_SUPPORTED210#define PNG_sRGB_SUPPORTED211#define PNG_tEXt_SUPPORTED212#define PNG_tIME_SUPPORTED213#define PNG_tRNS_SUPPORTED214#define PNG_zTXt_SUPPORTED215/* end of options */216/* settings */217#define PNG_API_RULE 0218#define PNG_COST_SHIFT 3219#define PNG_DEFAULT_READ_MACROS 1220#define PNG_GAMMA_THRESHOLD_FIXED 5000221#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE222#define PNG_INFLATE_BUF_SIZE 1024223#define PNG_MAX_GAMMA_8 11224#define PNG_QUANTIZE_BLUE_BITS 5225#define PNG_QUANTIZE_GREEN_BITS 5226#define PNG_QUANTIZE_RED_BITS 5227#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)228#define PNG_TEXT_Z_DEFAULT_STRATEGY 0229#define PNG_USER_CHUNK_CACHE_MAX 1000230#define PNG_USER_CHUNK_MALLOC_MAX 8000000231#define PNG_USER_HEIGHT_MAX 1000000232#define PNG_USER_WIDTH_MAX 1000000233#define PNG_WEIGHT_SHIFT 8234#define PNG_ZBUF_SIZE 8192235#define PNG_ZLIB_VERNUM 0 /* unknown */236#define PNG_Z_DEFAULT_COMPRESSION (-1)237#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0238#define PNG_Z_DEFAULT_STRATEGY 1239#define PNG_sCAL_PRECISION 5240#define PNG_sRGB_PROFILE_CHECKS 2241/* end of settings */242#endif /* PNGLCONF_H */...

Full Screen

Full Screen

ERC165Checker.test.js

Source:ERC165Checker.test.js Github

copy

Full Screen

1require('@openzeppelin/test-helpers');2const { expect } = require('chai');3const ERC165CheckerMock = artifacts.require('ERC165CheckerMock');4const ERC165NotSupported = artifacts.require('ERC165NotSupported');5const ERC165InterfacesSupported = artifacts.require('ERC165InterfacesSupported');6const DUMMY_ID = '0xdeadbeef';7const DUMMY_ID_2 = '0xcafebabe';8const DUMMY_ID_3 = '0xdecafbad';9const DUMMY_UNSUPPORTED_ID = '0xbaddcafe';10const DUMMY_UNSUPPORTED_ID_2 = '0xbaadcafe';11const DUMMY_ACCOUNT = '0x1111111111111111111111111111111111111111';12contract('ERC165Checker', function (accounts) {13 beforeEach(async function () {14 this.mock = await ERC165CheckerMock.new();15 });16 context('ERC165 not supported', function () {17 beforeEach(async function () {18 this.target = await ERC165NotSupported.new();19 });20 it('does not support ERC165', async function () {21 const supported = await this.mock.supportsERC165(this.target.address);22 expect(supported).to.equal(false);23 });24 it('does not support mock interface via supportsInterface', async function () {25 const supported = await this.mock.supportsInterface(this.target.address, DUMMY_ID);26 expect(supported).to.equal(false);27 });28 it('does not support mock interface via supportsAllInterfaces', async function () {29 const supported = await this.mock.supportsAllInterfaces(this.target.address, [DUMMY_ID]);30 expect(supported).to.equal(false);31 });32 it('does not support mock interface via getSupportedInterfaces', async function () {33 const supported = await this.mock.getSupportedInterfaces(this.target.address, [DUMMY_ID]);34 expect(supported.length).to.equal(1);35 expect(supported[0]).to.equal(false);36 });37 });38 context('ERC165 supported', function () {39 beforeEach(async function () {40 this.target = await ERC165InterfacesSupported.new([]);41 });42 it('supports ERC165', async function () {43 const supported = await this.mock.supportsERC165(this.target.address);44 expect(supported).to.equal(true);45 });46 it('does not support mock interface via supportsInterface', async function () {47 const supported = await this.mock.supportsInterface(this.target.address, DUMMY_ID);48 expect(supported).to.equal(false);49 });50 it('does not support mock interface via supportsAllInterfaces', async function () {51 const supported = await this.mock.supportsAllInterfaces(this.target.address, [DUMMY_ID]);52 expect(supported).to.equal(false);53 });54 it('does not support mock interface via getSupportedInterfaces', async function () {55 const supported = await this.mock.getSupportedInterfaces(this.target.address, [DUMMY_ID]);56 expect(supported.length).to.equal(1);57 expect(supported[0]).to.equal(false);58 });59 });60 context('ERC165 and single interface supported', function () {61 beforeEach(async function () {62 this.target = await ERC165InterfacesSupported.new([DUMMY_ID]);63 });64 it('supports ERC165', async function () {65 const supported = await this.mock.supportsERC165(this.target.address);66 expect(supported).to.equal(true);67 });68 it('supports mock interface via supportsInterface', async function () {69 const supported = await this.mock.supportsInterface(this.target.address, DUMMY_ID);70 expect(supported).to.equal(true);71 });72 it('supports mock interface via supportsAllInterfaces', async function () {73 const supported = await this.mock.supportsAllInterfaces(this.target.address, [DUMMY_ID]);74 expect(supported).to.equal(true);75 });76 it('supports mock interface via getSupportedInterfaces', async function () {77 const supported = await this.mock.getSupportedInterfaces(this.target.address, [DUMMY_ID]);78 expect(supported.length).to.equal(1);79 expect(supported[0]).to.equal(true);80 });81 });82 context('ERC165 and many interfaces supported', function () {83 beforeEach(async function () {84 this.supportedInterfaces = [DUMMY_ID, DUMMY_ID_2, DUMMY_ID_3];85 this.target = await ERC165InterfacesSupported.new(this.supportedInterfaces);86 });87 it('supports ERC165', async function () {88 const supported = await this.mock.supportsERC165(this.target.address);89 expect(supported).to.equal(true);90 });91 it('supports each interfaceId via supportsInterface', async function () {92 for (const interfaceId of this.supportedInterfaces) {93 const supported = await this.mock.supportsInterface(this.target.address, interfaceId);94 expect(supported).to.equal(true);95 };96 });97 it('supports all interfaceIds via supportsAllInterfaces', async function () {98 const supported = await this.mock.supportsAllInterfaces(this.target.address, this.supportedInterfaces);99 expect(supported).to.equal(true);100 });101 it('supports none of the interfaces queried via supportsAllInterfaces', async function () {102 const interfaceIdsToTest = [DUMMY_UNSUPPORTED_ID, DUMMY_UNSUPPORTED_ID_2];103 const supported = await this.mock.supportsAllInterfaces(this.target.address, interfaceIdsToTest);104 expect(supported).to.equal(false);105 });106 it('supports not all of the interfaces queried via supportsAllInterfaces', async function () {107 const interfaceIdsToTest = [...this.supportedInterfaces, DUMMY_UNSUPPORTED_ID];108 const supported = await this.mock.supportsAllInterfaces(this.target.address, interfaceIdsToTest);109 expect(supported).to.equal(false);110 });111 it('supports all interfaceIds via getSupportedInterfaces', async function () {112 const supported = await this.mock.getSupportedInterfaces(this.target.address, this.supportedInterfaces);113 expect(supported.length).to.equal(3);114 expect(supported[0]).to.equal(true);115 expect(supported[1]).to.equal(true);116 expect(supported[2]).to.equal(true);117 });118 it('supports none of the interfaces queried via getSupportedInterfaces', async function () {119 const interfaceIdsToTest = [DUMMY_UNSUPPORTED_ID, DUMMY_UNSUPPORTED_ID_2];120 const supported = await this.mock.getSupportedInterfaces(this.target.address, interfaceIdsToTest);121 expect(supported.length).to.equal(2);122 expect(supported[0]).to.equal(false);123 expect(supported[1]).to.equal(false);124 });125 it('supports not all of the interfaces queried via getSupportedInterfaces', async function () {126 const interfaceIdsToTest = [...this.supportedInterfaces, DUMMY_UNSUPPORTED_ID];127 const supported = await this.mock.getSupportedInterfaces(this.target.address, interfaceIdsToTest);128 expect(supported.length).to.equal(4);129 expect(supported[0]).to.equal(true);130 expect(supported[1]).to.equal(true);131 expect(supported[2]).to.equal(true);132 expect(supported[3]).to.equal(false);133 });134 });135 context('account address does not support ERC165', function () {136 it('does not support ERC165', async function () {137 const supported = await this.mock.supportsERC165(DUMMY_ACCOUNT);138 expect(supported).to.equal(false);139 });140 it('does not support mock interface via supportsInterface', async function () {141 const supported = await this.mock.supportsInterface(DUMMY_ACCOUNT, DUMMY_ID);142 expect(supported).to.equal(false);143 });144 it('does not support mock interface via supportsAllInterfaces', async function () {145 const supported = await this.mock.supportsAllInterfaces(DUMMY_ACCOUNT, [DUMMY_ID]);146 expect(supported).to.equal(false);147 });148 it('does not support mock interface via getSupportedInterfaces', async function () {149 const supported = await this.mock.getSupportedInterfaces(DUMMY_ACCOUNT, [DUMMY_ID]);150 expect(supported.length).to.equal(1);151 expect(supported[0]).to.equal(false);152 });153 });...

Full Screen

Full Screen

data.js

Source:data.js Github

copy

Full Screen

12function getData() {3 const vs97 = new Version('Visual Studio 97', 'Boston', 5.0, 'February 1997');4 const vs6 = new Version('Visual Studio 6.0', 'Aspen', 6.0, 'June 1998');5 const vs2002 = new Version('Visual Studio .NET (2002)', 'Rainier', 7.0, new Date(2002, 1, 13));6 vs2002.addSupportedFramework('.NET Framework', 1.0);7 const vs2003 = new Version('Visual Studio .NET 2003', 'Everett', 7.1, new Date(2003, 3, 24));8 vs2003.addSupportedFramework('.NET Framework', 1.1);9 const vs2005 = new Version('Visual Studio 2005', 'Whidbey', 8.0, new Date(2005, 10, 7));10 vs2005.addSupportedFramework('.NET Framework', 2.0);11 vs2005.addSupportedFramework('.NET Framework', 3.0);12 const vs2008 = new Version('Visual Studio 2008', 'Orcas', 9.0, new Date(2007, 10, 19));13 vs2008.addSupportedFramework('.NET Framework', 2.0);14 vs2008.addSupportedFramework('.NET Framework', 3.0);15 vs2008.addSupportedFramework('.NET Framework', 3.5);16 const vs2010 = new Version('Visual Studio 2010', 'Dev10/Rosario', 10.0, new Date(2010, 3, 12));17 vs2010.addSupportedFramework('.NET Framework', 2.0);18 vs2010.addSupportedFramework('.NET Framework', 3.0);19 vs2010.addSupportedFramework('.NET Framework', 3.5);20 vs2010.addSupportedFramework('.NET Framework', 4.0);21 const vs2012 = new Version('Visual Studio 2012', 'Dev11', 11.0, new Date(2012, 8, 12));22 vs2012.addSupportedFramework('.NET Framework', 2.0);23 vs2012.addSupportedFramework('.NET Framework', 3.0);24 vs2012.addSupportedFramework('.NET Framework', 3.5);25 vs2012.addSupportedFramework('.NET Framework', 4.0);26 vs2012.addSupportedFramework('.NET Framework', 4.5);27 const vs2013 = new Version('Visual Studio 2013', 'Dev12', 12.0, new Date(2013, 9, 17));28 vs2013.addSupportedFramework('.NET Framework', 2.0);29 vs2013.addSupportedFramework('.NET Framework', 3.0);30 vs2013.addSupportedFramework('.NET Framework', 3.5);31 vs2013.addSupportedFramework('.NET Framework', 4.0);32 vs2013.addSupportedFramework('.NET Framework', 4.5);33 const vs2015 = new Version('Visual Studio 2015', 'Dev14', 14.0, new Date(2015, 6, 20));34 vs2015.addSupportedFramework('.NET Framework', 2.0);35 vs2015.addSupportedFramework('.NET Framework', 3.0);36 vs2015.addSupportedFramework('.NET Framework', 3.5);37 vs2015.addSupportedFramework('.NET Framework', 4.0);38 vs2015.addSupportedFramework('.NET Framework', 4.5);39 vs2015.addSupportedFramework('.NET Framework', 4.6);40 const vs2017 = new Version('Visual Studio 2017', 'Dev15', 15.0, new Date(2017, 2, 7));41 vs2017.addSupportedFramework('.NET Framework', 2.0);42 vs2017.addSupportedFramework('.NET Framework', 3.0);43 vs2017.addSupportedFramework('.NET Framework', 3.5);44 vs2017.addSupportedFramework('.NET Framework', 4.0);45 vs2017.addSupportedFramework('.NET Framework', 4.5);46 vs2017.addSupportedFramework('.NET Framework', 4.6);47 vs2017.addSupportedFramework('.NET Core', 1.0);48 vs2017.addSupportedFramework('.NET Core', 1.1);49 return [50 vs97,51 vs6,52 vs2002,53 vs2003,54 vs2005,55 vs2008,56 vs2010,57 vs2012,58 vs2013,59 vs2015,60 vs201761 ];...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const port = 2525;3mb.create({4}).then(function (api) {5 console.log('mountebank server started');6 api.post('/imposters', {7 {8 {9 is: {10 headers: {11 },12 body: JSON.stringify({ hello: 'world' })13 }14 }15 }16 });17});18const mb = require('mountebank');19const port = 2525;20mb.create({21}).then(function (api) {22 console.log('mountebank server started');23 api.post('/imposters', {24 {25 {26 is: {27 headers: {28 },29 body: JSON.stringify({ hello: 'world' })30 }31 }32 }33 });34});35### create(options)36* `port` - the port on which the mountebank server will listen (default: 2525)37* `pidfile` - the file to which the mountebank process ID will be written (default: 'mb.pid')38* `logfile` - the file to which the mountebank log will be written (default: 'mb.log')39* `protofile` - the file to which the mountebank protocol will be written (default: 'mb.proto')40* `ipWhitelist` - an array of IP addresses that are allowed to access the API (default: ['*'])

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const port = 2525;3const imposters = [{4 stubs: [{5 predicates: [{6 equals: {7 },8 exists: {9 headers: {10 },11 query: {12 }13 }14 }],15 responses: [{16 is: {17 headers: {18 },19 body: {20 }21 }22 }]23 }]24}];25mb.create({port: port, pidfile: 'mb.pid', logfile: 'mb.log', ipWhitelist: ['*']}, function () {26 mb.startImposter(imposters, function (error) {27 if (error) {28 console.error(error);29 process.exit(1);30 }31 });32});33var http = require('http');34var mb = require('mountebank');35var server = http.createServer(function (request, response) {36 response.writeHead(200, {"Content-Type": "application/json"});37 response.end(JSON.stringify({success: true}));38});39mb.start(server, 3000, function () {40});

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var port = 2525;3var protocol = 'http';4 {5 {6 {7 equals: {8 }9 }10 {11 is: {12 headers: {13 },14 body: JSON.stringify({message: 'Hello World'})15 }16 }17 }18 }19];20mb.create({port: port}, imposters).then(function () {21 console.log('Mountebank started on port ' + port);22});23{24}25var express = require('express');26var app = express();27app.get('/test', function (req, res) {28 res.send('Hello World');29});30app.listen(3000, function () {31 console.log('App listening on port 3000');32});33var mb = require('mountebank');34var port = 2525;35var protocol = 'http';36 {

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const fs = require('fs');3const path = require('path');4const port = 2525;5const protocol = 'http';6const host = 'localhost';7const imposters = require('./imposters');8const impostersPath = path.join(__dirname, 'imposters');9const imposterFiles = fs.readdirSync(impostersPath);10const imposterData = imposterFiles.map(file => require(path.join(impostersPath, file)));11mb.start({ port, pidfile: 'mb.pid', logfile: 'mb.log', protocol, host, imposters })12 .then(() => {13 console.log('mountebank started');14 return imposterData.reduce((promise, imposter) => {15 return promise.then(() => {16 return fetch(api, {17 body: JSON.stringify(imposter),18 headers: { 'Content-Type': 'application/json' }19 });20 });21 }, Promise.resolve());22 })23 .then(() => console.log('imposters created'))24 .catch(error => console.error(error));25{26 "scripts": {27 },28 "dependencies": {29 }30}31{32 {33 {34 "is": {35 "headers": {36 },37 "body": {38 }39 }40 }41 }42}43const request = require('request');

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank/lib/models/mb');2var port = 2525;3mb.create(port, function (error, imposter) {4 imposter.post('/test', function (request, response) {5 response.statusCode = 200;6 response.body = 'Hello World';7 response.send();8 });9});

Full Screen

Using AI Code Generation

copy

Full Screen

1const mb = require('mountebank');2const imposters = require('./imposters.json');3const port = 2525;4mb.create(port, imposters).then(() => {5 console.log('mountebank started');6}).catch(err => {7 console.log('mountebank failed to start', err);8});9mb.stop().then(() => {10 console.log('mountebank stopped');11}).catch(err => {12 console.log('mountebank failed to stop', err);13});14mb.createImposter(2525, imposters).then(() => {15 console.log('imposter created');16}).catch(err => {17 console.log('imposter failed to create', err);18});19mb.stopImposter(2525, imposters).then(() => {20 console.log('imposter stopped');21}).catch(err => {22 console.log('imposter failed to stop', err);23});24mb.createStub(2525, imposters).then(() => {25 console.log('stub created');26}).catch(err => {27 console.log('stub failed to create', err);28});29mb.deleteStub(2525, imposters).then(() => {30 console.log('stub deleted');31}).catch(err => {32 console.log('stub failed to delete', err);33});34mb.createPredicate(2525, imposters).then(() => {35 console.log('predicate created');36}).catch(err => {37 console.log('predicate failed to create', err);38});39mb.deletePredicate(2525, imposters).then(() => {40 console.log('predicate deleted');41}).catch(err => {42 console.log('predicate failed to delete', err);43});44mb.createResponse(2525, imposters).then(() => {45 console.log('response created');46}).catch(err => {47 console.log('response failed to create', err);48});49mb.deleteResponse(2525, imposters).then(() => {50 console.log('response deleted');51}).catch(err => {52 console.log('response failed to delete', err);53});54mb.createProxy(2525, imposters).then(() =>

Full Screen

Using AI Code Generation

copy

Full Screen

1var mb = require('mountebank');2var imposter = mb.create();3imposter.post('/user', function (req, res) {4 res.send(200, { id: 1234 });5});6imposter.get('/user', function (req, res) {7 res.send(200, { name: "John" });8});9imposter.put('/user', function (req, res) {10 res.send(200, { name: "John" });11});12imposter.delete('/user', function (req, res) {13 res.send(200, { name: "John" });14});15imposter.patch('/user', function (req, res) {16 res.send(200, { name: "John" });17});18imposter.head('/user', function (req, res) {19 res.send(200, { name: "John" });20});21imposter.options('/user', function (req, res) {22 res.send(200, { name: "John" });23});24imposter.connect('/user', function (req, res) {25 res.send(200, { name: "John" });26});27imposter.trace('/user', function (req, res) {28 res.send(200, { name: "John" });29});30imposter.start(2525);31imposter.start(2526, 'localhost', function () {32 console.log('imposter started');33});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run mountebank automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful