hash
stringlengths
40
40
diff
stringlengths
131
114k
message
stringlengths
7
980
project
stringlengths
5
67
split
stringclasses
1 value
d568cfc14ae18750a2792241ddb5a72de090ad3b
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java index <HASH>..<HASH> 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java @@ -1050,7 +1050,7 @@ public class DefaultHttp2Connection implements Http2Connection { } if (state.localSideOpen() || state.remoteSideOpen()) { if (!canOpenStream()) { - throw connectionError(REFUSED_STREAM, "Maximum active streams violated for this endpoint."); + throw streamError(streamId, REFUSED_STREAM, "Maximum active streams violated for this endpoint."); } } else if (numStreams == maxStreams) { throw streamError(streamId, REFUSED_STREAM, "Maximum streams violated for this endpoint.");
HTTP/2: Treat MAX_CONCURRENT_STREAMS exceeded as a stream error. Motivation: As per the HTTP/2 spec, exceeding the MAX_CONCURRENT_STREAMS should be treated as a stream error as opposed to a connection error. "An endpoint that receives a HEADERS frame that causes its advertised concurrent stream limit to be exceeded MUST treat this as a stream error (Section <I>) of type PROTOCOL_ERROR or REFUSED_STREAM." <URL>
netty_netty
train
d4caba6378758aba467be44ecd01333022600e72
diff --git a/aeron-driver/src/main/java/io/aeron/driver/media/UdpChannelTransport.java b/aeron-driver/src/main/java/io/aeron/driver/media/UdpChannelTransport.java index <HASH>..<HASH> 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/media/UdpChannelTransport.java +++ b/aeron-driver/src/main/java/io/aeron/driver/media/UdpChannelTransport.java @@ -46,6 +46,7 @@ public abstract class UdpChannelTransport implements AutoCloseable protected InetSocketAddress connectAddress; protected DatagramChannel sendDatagramChannel; protected DatagramChannel receiveDatagramChannel; + protected int multicastTtl = 0; public UdpChannelTransport( final UdpChannel udpChannel, @@ -91,6 +92,7 @@ public abstract class UdpChannelTransport implements AutoCloseable if (0 != udpChannel.multicastTtl()) { sendDatagramChannel.setOption(StandardSocketOptions.IP_MULTICAST_TTL, udpChannel.multicastTtl()); + multicastTtl = getOption(StandardSocketOptions.IP_MULTICAST_TTL); } if (null != connectAddress) @@ -166,23 +168,7 @@ public abstract class UdpChannelTransport implements AutoCloseable */ public int multicastTtl() { - int result = udpChannel.multicastTtl(); - - if (isMulticast()) - { - if (0 == udpChannel.multicastTtl()) - { - try - { - result = sendDatagramChannel.getOption(IP_MULTICAST_TTL); - } - catch (final Exception ignore) - { - } - } - } - - return result; + return multicastTtl; } /**
[Java] Cache multicast TTL to save socket option lookup on each call.
real-logic_aeron
train
4dfde13593477520598aff394b8dd7afb4e8a133
diff --git a/src/main/java/act/inject/util/ResourceLoader.java b/src/main/java/act/inject/util/ResourceLoader.java index <HASH>..<HASH> 100644 --- a/src/main/java/act/inject/util/ResourceLoader.java +++ b/src/main/java/act/inject/util/ResourceLoader.java @@ -25,8 +25,7 @@ import act.app.App; import act.app.data.StringValueResolverManager; import act.util.HeaderMapping; import act.util.Jars; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.*; import org.osgl.$; import org.osgl.exception.UnexpectedException; import org.osgl.inject.BeanSpec; @@ -38,6 +37,7 @@ import org.osgl.logging.Logger; import org.osgl.storage.ISObject; import org.osgl.storage.impl.SObject; import org.osgl.util.*; +import org.osgl.util.TypeReference; import org.yaml.snakeyaml.Yaml; import java.io.File; @@ -320,8 +320,13 @@ public class ResourceLoader<T> extends ValueLoader.Base<T> { boolean isXml = resourcePath.endsWith(".xml"); if (isXml) { Object o = XML.read(url); - JSONObject json = $.convert(o).to(JSONObject.class); - return $.map(json).targetGenericType(spec.type()).to(rawType); + if ($.isCollectionType(rawType)) { + JSONArray array = $.convert(o).to(JSONArray.class); + return $.map(array).targetGenericType(spec.type()).to(rawType); + } else { + JSONObject json = $.convert(o).to(JSONObject.class); + return $.map(json).targetGenericType(spec.type()).to(rawType); + } } if (String.class == rawType) { return IO.readContentAsString(url);
[#<I>] - allow loading XML resource into collection types
actframework_actframework
train
16f47f62f01d485cfbbdeee4c338ce2240c93bf3
diff --git a/src/Leaves/CommunicationItem/CommunicationItemSearchPanel.php b/src/Leaves/CommunicationItem/CommunicationItemSearchPanel.php index <HASH>..<HASH> 100644 --- a/src/Leaves/CommunicationItem/CommunicationItemSearchPanel.php +++ b/src/Leaves/CommunicationItem/CommunicationItemSearchPanel.php @@ -56,17 +56,17 @@ class CommunicationItemSearchPanel extends SearchPanel $filterGroup->addFilters(new Contains('Recipient', $searchValues['Recipient'])); } - if ($searchValues['CreatedAfter']) { + if ($searchValues['CreatedAfter'] && $searchValues['CreatedAfter']->isValidDateTime()) { $filterGroup->addFilters(new GreaterThan('DateCreated', $searchValues['CreatedAfter'])); } - if ($searchValues['CreatedBefore']) { + if ($searchValues['CreatedBefore'] && $searchValues['CreatedBefore']->isValidDateTime()) { $filterGroup->addFilters(new LessThan('DateCreated', $searchValues['CreatedBefore'])); } - if ($searchValues['SentAfter']) { + if ($searchValues['SentAfter'] && $searchValues['SentAfter']->isValidDateTime()) { $filterGroup->addFilters(new GreaterThan('DateSent', $searchValues['SentAfter'])); } - if ($searchValues['SentBefore']) { + if ($searchValues['SentBefore'] && $searchValues['SentBefore']->isValidDateTime()) { $filterGroup->addFilters(new LessThan('DateSent', $searchValues['SentBefore'])); } }
Fix email search thinking empty dates are valid
RhubarbPHP_Scaffold.Communications
train
37e1cf36db271c7668894c882857493b74c5fd5e
diff --git a/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/index.js b/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/index.js index <HASH>..<HASH> 100644 --- a/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/index.js +++ b/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/index.js @@ -2,11 +2,11 @@ module.exports = Component; function Component() {} -Component.prototype.start = function($happn, callback) { +Component.prototype.start = function(callback) { callback(); }; -Component.prototype.stop = function($happn, callback) { +Component.prototype.stop = function(callback) { callback(); }; diff --git a/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/package.json b/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/package.json index <HASH>..<HASH> 100644 --- a/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/package.json +++ b/test/_lib/integration-29-cluster-dependencies-asAdmin-call/edge-component/package.json @@ -1,4 +1,14 @@ { "name": "broker-component", - "version": "1.0.1" + "version": "1.0.1", + "happner": { + "dependencies": { + "$broker": { + "remoteComponent": { + "version": "*", + "discoverMethods": true + } + } + } + } } diff --git a/test/integration/29-cluster-dependencies-asAdmin-call.js b/test/integration/29-cluster-dependencies-asAdmin-call.js index <HASH>..<HASH> 100644 --- a/test/integration/29-cluster-dependencies-asAdmin-call.js +++ b/test/integration/29-cluster-dependencies-asAdmin-call.js @@ -49,7 +49,9 @@ describe(test.testName(__filename, 3), function() { } test .expect(errorMessage) - .to.be('invalid endpoint options: [remoteComponent] component does not exist on the api'); + .to.be( + 'invalid endpoint options: [remoteComponent.remoteMethod] method does not exist on the api' + ); await startInternal(getSeq.getNext(), 2); await test.delay(2000); await client.exchange.edgeComponent.callRemote(); @@ -57,6 +59,7 @@ describe(test.testName(__filename, 3), function() { function localInstanceConfig(seq, sync) { var config = baseConfig(seq, sync, true); + //config.cluster.dependenciesSatisfiedDeferListen = true; config.modules = { edgeComponent: { path: libDir + 'edge-component' diff --git a/test/unit/02-broker-component.js b/test/unit/02-broker-component.js index <HASH>..<HASH> 100644 --- a/test/unit/02-broker-component.js +++ b/test/unit/02-broker-component.js @@ -292,6 +292,11 @@ describe('02 - unit - brokerage component', function() { return new Promise(resolve => { resolve(); }); + }, + _mesh: { + config: { + name: 'test' + } } };
SMC-<I>: fixed tests
happner_happner-cluster
train
953b4e56f868a6272ccc5ea7873d44a20631de81
diff --git a/Kwc/Abstract/Image/Component.php b/Kwc/Abstract/Image/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Abstract/Image/Component.php +++ b/Kwc/Abstract/Image/Component.php @@ -396,7 +396,7 @@ class Kwc_Abstract_Image_Component extends Kwc_Abstract_Composite_Component $data = $this->_getImageDataOrEmptyImageData(); $s = $this->getConfiguredImageDimensions(); if ($s['width'] === self::CONTENT_WIDTH) { - return parent::getContentWidth(); + return $this->getMaxContentWidth(); } if ($data) { if (isset($data['image'])) { diff --git a/Kwc/Abstract/Image/Trl/Image/Component.php b/Kwc/Abstract/Image/Trl/Image/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Abstract/Image/Trl/Image/Component.php +++ b/Kwc/Abstract/Image/Trl/Image/Component.php @@ -43,4 +43,9 @@ class Kwc_Abstract_Image_Trl_Image_Component extends Kwc_Abstract_Image_Componen } return $ret; } + + public function getMaxContentWidth() + { + return $this->getData()->parent->chained->getComponent()->getMaxContentWidth(); + } }
Fix getMaxContentWidth for for Image_Trl_Image Default implementation of getContentWidth did access MasterLayout contentWidth setting which doesn't exist for Trl. Change call to parent::getContentWdith() to getMaxContentWidth for easier overriding in Trl_Image
koala-framework_koala-framework
train
c9616875eccba81c69bb5f1a4c558004c7a3b7d9
diff --git a/lib/XMLHttpRequest.js b/lib/XMLHttpRequest.js index <HASH>..<HASH> 100644 --- a/lib/XMLHttpRequest.js +++ b/lib/XMLHttpRequest.js @@ -187,11 +187,12 @@ exports.XMLHttpRequest = function() { * @return string Text of the header or null if it doesn't exist. */ this.getResponseHeader = function(header) { - if (this.readyState > this.OPENED - && response.headers[header] + if (typeof header === "string" + && this.readyState > this.OPENED + && response.headers[header.toLowerCase()] && !errorFlag ) { - return response.headers[header]; + return response.headers[header.toLowerCase()]; } return null; @@ -209,9 +210,8 @@ exports.XMLHttpRequest = function() { var result = ""; for (var i in response.headers) { - var headerName = i.toLowerCase(); // Cookie headers are excluded - if (headerName !== "set-cookie" && headerName !== "set-cookie2") { + if (i !== "set-cookie" && i !== "set-cookie2") { result += i + ": " + response.headers[i] + "\r\n"; } }
Node sets response headers as lower case so use toLowerCase in getResponseHeader and don't use it in getAllReseponseHeaders.
driverdan_node-XMLHttpRequest
train
6706bb8fa67b600337362c124042628babad4774
diff --git a/CHANGELOG b/CHANGELOG index <HASH>..<HASH> 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,22 @@ ================================================================================ CHANGELOG ================================================================================ + + 0.4.1.4 + Jun 28, 2009 + + * extra/tablature.py: Added from_Track (issue #5), added get_qsize + (closes issue #58) +================================================================================ + 0.4.1.3 Jun 28, 2009 * extra/tablature.py: Added tablature module that can convert some of the mingus.containers to pretty ascii tablature. (issue #5) + * extra/tunings.py: Sort and return fingerings on fitness. (Closes + issue #53) ================================================================================ @@ -20,7 +30,7 @@ CHANGELOG already existing Note object (hardcopy) or an integer (conversion). * containers/Note.py: Added from_shorthand and to_shorthand which converts from and to traditional Helmhotz pitch notation. (Closes - issue #49 + issue #49) ================================================================================ diff --git a/mingus/containers/NoteContainer.py b/mingus/containers/NoteContainer.py index <HASH>..<HASH> 100644 --- a/mingus/containers/NoteContainer.py +++ b/mingus/containers/NoteContainer.py @@ -48,7 +48,7 @@ to high. The note can either be a string, in which case you could \ also use the octave and dynamics arguments, or a Note object.""" if type(note) == str: - if octave != None: + if octave is not None: note = Note(note, octave, dynamics) elif len(self.notes) == 0: note = Note(note, 4, dynamics) diff --git a/mingus/extra/tablature.py b/mingus/extra/tablature.py index <HASH>..<HASH> 100644 --- a/mingus/extra/tablature.py +++ b/mingus/extra/tablature.py @@ -84,14 +84,14 @@ def from_NoteContainer(notes, tuning = None): return result -def from_Bar(bar, tuning = None): +def from_Bar(bar, width = 40, tuning = None): if tuning is None: tuning = tunings.get_tuning("Guitar", "Standard") - qsize = 12 - result = begin_track(tuning, qsize / 2) + qsize = _get_qsize(tuning, width) + result = begin_track(tuning, max(2, qsize / 2)) for entry in bar.bar: beat, duration, notes = entry @@ -123,3 +123,40 @@ def from_Bar(bar, tuning = None): result.reverse() return result + +def from_Track(track, maxwidth = 80, tuning = None): + result = [] + + if maxwidth < 60: + width = maxwidth + elif 60 < maxwidth < 120: + width = maxwidth / 2 + elif 120 < maxwidth: + width = maxwidth / 3 + + lastlen = 0 + for bar in track: + r = from_Bar(bar, width, tuning) + barstart = r[0].find("||") + 2 + + if len(r[0]) + lastlen - barstart < maxwidth and result != []: + for i in range(1, len(r) + 1): + item = r[len(r) - i] + result[-i] += item[barstart:] + else: + result += [""] + r + lastlen = len(result[-1]) + return result + + +def _get_qsize(tuning, width): + names = [ x.to_shorthand() for x in tuning.tuning ] + basesize = len(max(names)) + 3 + barsize = width - basesize - 2 - 1 + + # x * 4 + x / 2 - barsize = 0 + # x(4 + 0.5) - barsize= 0 + # 4.5x = barsize + # x = barsize / 4.5 + + return int(barsize / 4.5) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup setup(name= "mingus", - version = "0.4.1.3", + version = "0.4.1.4", description = "mingus is an advanced music theory and notation package", long_description = "mingus is an advanced music theory and notation package "\ "for Python with MIDI playback support. It can be used to play "\
Added get_qsize and beautified Tracks and Bars
bspaans_python-mingus
train
476586b810a98d06be477fd01c4309c74993e1b4
diff --git a/lib/classes/Swift/Transport/MailTransport.php b/lib/classes/Swift/Transport/MailTransport.php index <HASH>..<HASH> 100644 --- a/lib/classes/Swift/Transport/MailTransport.php +++ b/lib/classes/Swift/Transport/MailTransport.php @@ -126,8 +126,14 @@ class Swift_Transport_MailTransport implements Swift_Transport $toHeader = $message->getHeaders()->get('To'); $subjectHeader = $message->getHeaders()->get('Subject'); + if (!$toHeader) + { + throw new Swift_TransportException( + 'Cannot send message without a recipient' + ); + } $to = $toHeader->getFieldBody(); - $subject = $subjectHeader->getFieldBody(); + $subject = $subjectHeader ? $subjectHeader->getFieldBody() : ''; $reversePath = $this->_getReversePath($message);
fixed fatal errors when no To or Subject header has been set
swiftmailer_swiftmailer
train
eff8762a9394b81c41f0a523fabe12bf124c5baa
diff --git a/Connector/ZimbraConnector.php b/Connector/ZimbraConnector.php index <HASH>..<HASH> 100644 --- a/Connector/ZimbraConnector.php +++ b/Connector/ZimbraConnector.php @@ -69,6 +69,7 @@ class ZimbraConnector * @var int */ private $authRequestDelay; + private $ignoreDelegatedAuth; public function __construct( Wrapper $httpClient, @@ -78,7 +79,8 @@ class ZimbraConnector $fopen = true, $sessionPath = null, $restServerBaseUrl = null, - $authRequestDelay = 0 + $authRequestDelay = 0, + $ignoreDelegatedAuth = false ) { $this->httpClient = $httpClient; $this->server = $server; @@ -87,11 +89,12 @@ class ZimbraConnector $this->fopen = $fopen; $this->sessionPath = $sessionPath; $this->restServerBaseUrl = $restServerBaseUrl; + $this->authRequestDelay = $authRequestDelay; + $this->ignoreDelegatedAuth = $ignoreDelegatedAuth; if (!empty($this->sessionPath) && file_exists($this->sessionPath)) { $this->authToken = file_get_contents($this->sessionPath); } - $this->authRequestDelay = $authRequestDelay; } /** @@ -877,6 +880,11 @@ class ZimbraConnector public function delegateAuth($account) { + if ($this->ignoreDelegatedAuth) { + + return false; + } + if ($this->delegatedAuthAccount != $account) { $response = $this->request( 'DelegateAuth', diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -43,6 +43,9 @@ class Configuration implements ConfigurationInterface ->scalarNode('auth_propagation_time') ->defaultValue(0) ->end() + ->scalarNode('ignore_delegated_auth') + ->defaultFalse() + ->end() ->end(); return $treeBuilder; diff --git a/DependencyInjection/SynaqZasaExtension.php b/DependencyInjection/SynaqZasaExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/SynaqZasaExtension.php +++ b/DependencyInjection/SynaqZasaExtension.php @@ -55,5 +55,6 @@ class SynaqZasaExtension extends Extension $container->setParameter('synaq_zasa.auth_token_path', $config['auth_token_path']); $container->setParameter('synaq_zasa.rest_base_url', $config['rest_base_url']); $container->setParameter('synaq_zasa.auth_propagation_time', $config['auth_propagation_time']); + $container->setParameter('synaq_zasa.ignore_delegated_auth', $config['ignore_delegated_auth']); } } diff --git a/Resources/config/services.xml b/Resources/config/services.xml index <HASH>..<HASH> 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -11,6 +11,7 @@ <parameter key="synaq_zasa.use_fopen"/> <parameter key="synaq_zasa.auth_token_path"/> <parameter key="synaq_zasa.auth_propagation_time"/> + <parameter key="synaq_zasa.ignore_delegated_auth"/> </parameters> <services> @@ -23,6 +24,7 @@ <argument>%synaq_zasa.auth_token_path%</argument> <argument>%synaq_zasa.rest_base_url%</argument> <argument>%synaq_zasa.auth_propagation_time%</argument> + <argument>%synaq_zasa.ignore_delegated_auth%</argument> </service> </services> </container>
Added configurable option to ignore delegated auth requests
synaq_SynaqZasaBundle
train
07b6b80f5d6572296041f584abfdd3814437791e
diff --git a/pkg/cmd/server/etcd/etcd.go b/pkg/cmd/server/etcd/etcd.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/server/etcd/etcd.go +++ b/pkg/cmd/server/etcd/etcd.go @@ -19,6 +19,7 @@ import ( // GetAndTestEtcdClient creates an etcd client based on the provided config. It will attempt to // connect to the etcd server and block until the server responds at least once, or return an // error if the server never responded. +// TODO: switch this function to use EtcdHelper. func GetAndTestEtcdClient(etcdClientInfo configapi.EtcdConnectionInfo) (*etcdclient.Client, error) { etcdClient, err := EtcdClient(etcdClientInfo) if err != nil { diff --git a/pkg/cmd/server/origin/master_config.go b/pkg/cmd/server/origin/master_config.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/server/origin/master_config.go +++ b/pkg/cmd/server/origin/master_config.go @@ -97,9 +97,6 @@ type MasterConfig struct { ImageFor func(component string) string EtcdHelper storage.Interface - // Storage interface no longer exposes the client since it is now generic. This allows us - // to provide access to the client for things that need it. - EtcdClient *etcdclient.Client KubeletClientConfig *kubeletclient.KubeletClientConfig @@ -228,7 +225,6 @@ func BuildMasterConfig(options configapi.MasterConfig) (*MasterConfig, error) { ImageFor: imageTemplate.ExpandOrDie, EtcdHelper: etcdHelper, - EtcdClient: client, KubeletClientConfig: kubeletClientConfig, ClientCAs: clientCAs, diff --git a/pkg/cmd/server/origin/run_components.go b/pkg/cmd/server/origin/run_components.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/server/origin/run_components.go +++ b/pkg/cmd/server/origin/run_components.go @@ -21,6 +21,7 @@ import ( buildclient "github.com/openshift/origin/pkg/build/client" buildcontrollerfactory "github.com/openshift/origin/pkg/build/controller/factory" buildstrategy "github.com/openshift/origin/pkg/build/controller/strategy" + "github.com/openshift/origin/pkg/cmd/server/etcd" cmdutil "github.com/openshift/origin/pkg/cmd/util" "github.com/openshift/origin/pkg/cmd/util/clientcmd" configchangecontroller "github.com/openshift/origin/pkg/deploy/controller/configchange" @@ -167,7 +168,12 @@ func (c *MasterConfig) RunDNSServer() { } go func() { - err := dns.ListenAndServe(config, c.DNSServerClient(), c.EtcdClient) + etcdClient, err := etcd.GetAndTestEtcdClient(c.Options.EtcdClientInfo) + if err != nil { + glog.Fatalf("Could not get etcd client: %v", err) + return + } + err = dns.ListenAndServe(config, c.DNSServerClient(), etcdClient) glog.Fatalf("Could not start DNS: %v", err) }() diff --git a/pkg/cmd/server/start/start_master.go b/pkg/cmd/server/start/start_master.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/server/start/start_master.go +++ b/pkg/cmd/server/start/start_master.go @@ -429,8 +429,10 @@ func StartAPI(oc *origin.MasterConfig, kc *kubernetes.MasterConfig) error { } // verify we can connect to etcd with the provided config - if err := etcd.TestEtcdClient(oc.EtcdClient); err != nil { + if etcdClient, err := etcd.GetAndTestEtcdClient(oc.Options.EtcdClientInfo); err != nil { return err + } else { + etcdClient.Close() } // Must start policy caching immediately
Remove EtcdClient from MasterConfig
openshift_origin
train
a19b6d30bcfc54702d15a824d516c6322d7fd105
diff --git a/tests/fake_api.py b/tests/fake_api.py index <HASH>..<HASH> 100644 --- a/tests/fake_api.py +++ b/tests/fake_api.py @@ -101,7 +101,7 @@ class ResponseMapping(object): this_dir = os.path.dirname(this_file) json_path = os.path.join(this_dir, "mock_jsons", self.version, file_name) with open(json_path, "r") as fd: - return fd.read() + return fd.read().encode("utf-8") def response_mapping(self, url_path, method): global DEFINITION
tests: gettting mock data: convert bytes to unicde
projectatomic_osbs-client
train
2cd3d32089bc0d2ee1ef0eb993b5b0c9428563cc
diff --git a/spec/views/hyrax/base/show.html.erb_spec.rb b/spec/views/hyrax/base/show.html.erb_spec.rb index <HASH>..<HASH> 100644 --- a/spec/views/hyrax/base/show.html.erb_spec.rb +++ b/spec/views/hyrax/base/show.html.erb_spec.rb @@ -82,7 +82,7 @@ RSpec.describe 'hyrax/base/show.html.erb', type: :view do end end - context 'when presenter says it is enabled' do + context 'when presenter says it is disabled' do let(:viewer_enabled) { false } it 'omits the UniversalViewer' do
Fix typo in show view spec description The tests check the _dis_abled state, the description is changed to reflect this.
samvera_hyrax
train
f2e65e39095d37ab4f3c459258e975d431394e81
diff --git a/lib/logging/log_event.rb b/lib/logging/log_event.rb index <HASH>..<HASH> 100644 --- a/lib/logging/log_event.rb +++ b/lib/logging/log_event.rb @@ -11,7 +11,7 @@ module Logging # * $1 == filename # * $2 == line number # * $3 == method name (might be nil) - CALLER_RGXP = %r/([-\.\/\(\)\w]+):(\d+)(?::in `(\w+)')?/o + CALLER_RGXP = %r/([-\.\/\(\)\w]+):(\d+)(?::in `([\s\w]+)')?/o #CALLER_INDEX = 2 CALLER_INDEX = ((defined? JRUBY_VERSION and JRUBY_VERSION > '1.6') or (defined? RUBY_ENGINE and RUBY_ENGINE[%r/^rbx/i])) ? 1 : 2 # :startdoc:
accept whitespace in traced method name
TwP_logging
train
d9e071492ed0090924163d1d9b2d51a5605f2d63
diff --git a/faker-core/src/main/java/io/kimo/lib/faker/Faker.java b/faker-core/src/main/java/io/kimo/lib/faker/Faker.java index <HASH>..<HASH> 100644 --- a/faker-core/src/main/java/io/kimo/lib/faker/Faker.java +++ b/faker-core/src/main/java/io/kimo/lib/faker/Faker.java @@ -90,6 +90,8 @@ public class Faker { } } catch (Exception e) { e.printStackTrace(); + } finally { + mFaker = null; } }
Forcing Faker to be reseted after the call of fill function
thiagokimo_Faker
train
e5b81ff2fa8e9c3d6379b062487376c6dede121d
diff --git a/test/client/config.js b/test/client/config.js index <HASH>..<HASH> 100644 --- a/test/client/config.js +++ b/test/client/config.js @@ -1,7 +1,9 @@ // Sample Testacular configuration file, that contain pretty much all the available options // It's used for running client tests on Travis (http://travis-ci.org/#!/vojtajina/testacular) // Most of the options can be overriden by cli arguments (see testacular --help) - +// +// For all available config options and default values, see: +// https://github.com/vojtajina/testacular/blob/stable/lib/config.js#L54 // base path, that will be used to resolve files and exclude @@ -55,3 +57,8 @@ singleRun = false; // report which specs are slower than 500ms reportSlowerThan = 500; + +// compile coffee scripts +preprocessors = { + '**/*.coffee': 'coffee' +};
Update sample test/client/config.js
karma-runner_karma
train
5a1b0bb890cb3d6c0ba2dcf05996f7fed8d3b751
diff --git a/src/websockets/auth.py b/src/websockets/auth.py index <HASH>..<HASH> 100644 --- a/src/websockets/auth.py +++ b/src/websockets/auth.py @@ -75,7 +75,11 @@ class BasicAuthWebSocketServerProtocol(WebSocketServerProtocol): ) if not await self.check_credentials(username, password): - return (http.HTTPStatus.FORBIDDEN, [], b"Invalid credentials\n") + return ( + http.HTTPStatus.UNAUTHORIZED, + [("WWW-Authenticate", build_www_authenticate_basic(self.realm))], + b"Invalid credentials\n", + ) self.username = username diff --git a/tests/test_auth.py b/tests/test_auth.py index <HASH>..<HASH> 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -122,7 +122,7 @@ class AuthClientServerTests(ClientServerTestsMixin, AsyncioTestCase): def test_basic_auth_invalid_credentials(self): with self.assertRaises(InvalidStatusCode) as raised: self.start_client(user_info=("hello", "ihateyou")) - self.assertEqual(raised.exception.status_code, 403) + self.assertEqual(raised.exception.status_code, 401) @with_server(create_protocol=create_protocol) def test_basic_auth_invalid_credentials_details(self): @@ -131,6 +131,9 @@ class AuthClientServerTests(ClientServerTestsMixin, AsyncioTestCase): self.loop.run_until_complete( self.make_http_request(headers={"Authorization": authorization}) ) - self.assertEqual(raised.exception.code, 403) - self.assertNotIn("WWW-Authenticate", raised.exception.headers) + self.assertEqual(raised.exception.code, 401) + self.assertEqual( + raised.exception.headers["WWW-Authenticate"], + 'Basic realm="auth-tests", charset="UTF-8"', + ) self.assertEqual(raised.exception.read().decode(), "Invalid credentials\n")
Change status code for invalid credentials to <I>. <I> means the credentials are valid but don't provide permissions.
aaugustin_websockets
train
486d6f66bc8085e7a67c2935ff26ec7794d43985
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -102,7 +102,7 @@ function bundleBrowserify(browserify) { //////////////////////////////////////// // watch-core //////////////////////////////////////// -gulp.task('watch-core', function(done) { +gulp.task('watch-core', function() { var b = createBrowserify({watch: true}); b.on('update', function(event) { @@ -399,7 +399,7 @@ gulp.task('dist-no-build', [], distFiles); //////////////////////////////////////// // serve //////////////////////////////////////// -gulp.task('serve', ['jshint', 'prepare', 'browser-sync', 'watch-core-test'], function() { +gulp.task('serve', ['jshint', 'prepare', 'browser-sync', 'watch-core'], function() { gulp.watch(['framework/templates/*.tpl'], ['html2js']); var watched = [
chore(gulp serve, gulp watch-core): Refined.
OnsenUI_OnsenUI
train
18473c1db680512d09033181dab2c966c2542d68
diff --git a/tests/digitalocean/helper.rb b/tests/digitalocean/helper.rb index <HASH>..<HASH> 100644 --- a/tests/digitalocean/helper.rb +++ b/tests/digitalocean/helper.rb @@ -32,7 +32,7 @@ def fog_test_server_destroy end at_exit do - unless Fog.mocking? + unless Fog.mocking? || Fog.credentials[:digitalocean_api_key].nil? server = service.servers.find { |s| s.name == 'fog-test-server' } if server server.wait_for(120) do
[digitalocean] Check to see if we have a digital ocean api key before attempting to delete servers
fog_fog
train
f2cd0d133357ca919c8a94ba0a5e56e265a40e18
diff --git a/itests/src/test/java/org/openengsb/itests/exam/JMSPortIT.java b/itests/src/test/java/org/openengsb/itests/exam/JMSPortIT.java index <HASH>..<HASH> 100644 --- a/itests/src/test/java/org/openengsb/itests/exam/JMSPortIT.java +++ b/itests/src/test/java/org/openengsb/itests/exam/JMSPortIT.java @@ -27,7 +27,6 @@ import java.io.InputStream; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.commons.io.IOUtils; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.openengsb.core.api.remote.OutgoingPort; @@ -51,7 +50,6 @@ public class JMSPortIT extends AbstractExamTestHelper { } @Test - @Ignore("This is a problem because blueprint is not going down correctly (OPENENGSB-1212)") public void jmsPort_shouldBeExportedWithCorrectId() throws Exception { OutgoingPort serviceWithId = OpenEngSBCoreServices.getServiceUtilsService().getServiceWithId(OutgoingPort.class, "jms-json", 60000); @@ -60,11 +58,10 @@ public class JMSPortIT extends AbstractExamTestHelper { } @Test - @Ignore("This is a problem because blueprint is not going down correctly (OPENENGSB-1212)") public void startSimpleWorkflow_ShouldReturn42() throws Exception { addWorkflow("simpleFlow"); - System.out.println("Starting Integration Test"); - ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:6549"); + ActiveMQConnectionFactory cf = + new ActiveMQConnectionFactory("failover:(tcp://localhost:6549)?timeout=60000"); JmsTemplate template = new JmsTemplate(cf); String request = "" + "{" diff --git a/itests/src/test/java/org/openengsb/itests/util/AbstractExamTestHelper.java b/itests/src/test/java/org/openengsb/itests/util/AbstractExamTestHelper.java index <HASH>..<HASH> 100644 --- a/itests/src/test/java/org/openengsb/itests/util/AbstractExamTestHelper.java +++ b/itests/src/test/java/org/openengsb/itests/util/AbstractExamTestHelper.java @@ -205,12 +205,11 @@ public abstract class AbstractExamTestHelper extends AbstractIntegrationTest { scanFeatures( maven().groupId("org.openengsb").artifactId("openengsb").type("xml").classifier("features-itests") .versionAsInProject(), "activemq-blueprint", "openengsb-connector-memoryauditing", - "openengsb-ui-admin"), + "openengsb-ports-jms", "openengsb-ui-admin"), workingDirectory(getWorkingDirectory()), vmOption("-Dorg.osgi.framework.system.packages.extra=sun.reflect"), vmOption("-Dorg.osgi.service.http.port=" + WEBUI_PORT), waitForFrameworkStartup(), mavenBundle(maven().groupId("org.openengsb.wrapped").artifactId("net.sourceforge.htmlunit-all") .versionAsInProject()), felix()); } - }
[OPENENGSB-<I>] Fixed integration tests for JMS
openengsb_openengsb
train
09131df0e549ddcf8db82f986fc4344587c4b2f8
diff --git a/test/db/mysql/simple_test.rb b/test/db/mysql/simple_test.rb index <HASH>..<HASH> 100644 --- a/test/db/mysql/simple_test.rb +++ b/test/db/mysql/simple_test.rb @@ -155,11 +155,6 @@ class MySQLSimpleTest < Test::Unit::TestCase end end - def test_reports_server_version - assert_instance_of Array, ActiveRecord::Base.connection.send(:version) - assert_equal 3, ActiveRecord::Base.connection.send(:version).size - end - def test_update_sql_public_and_returns_rows_affected ActiveRecord::Base.connection.update_sql "UPDATE entries SET title = NULL"
mysql returns Version object now and this is tested by AR test suite
jruby_activerecord-jdbc-adapter
train
9ceae2f041a86f3f64d475322eedb2e5f049fe23
diff --git a/Lib/glyphsLib/builder/builders.py b/Lib/glyphsLib/builder/builders.py index <HASH>..<HASH> 100644 --- a/Lib/glyphsLib/builder/builders.py +++ b/Lib/glyphsLib/builder/builders.py @@ -154,19 +154,22 @@ class UFOBuilder(_LoggerMixin): for glyph, layer in supplementary_layer_data: if (layer.layerId not in master_layer_ids and layer.associatedMasterId not in master_layer_ids): - self.logger.warning( - '{}, glyph "{}": Layer "{}" is dangling and will be ' - 'skipped. Did you copy a glyph from a different font? If ' - 'so, you should clean up any phantom layers not associated ' - 'with an actual master.'.format(self.font.familyName, - glyph.name, layer.layerId)) + if self.minimize_glyphs_diffs: + self.logger.warning( + '{}, glyph "{}": Layer "{}" is dangling and will be ' + 'skipped. Did you copy a glyph from a different font?' + ' If so, you should clean up any phantom layers not ' + 'associated with an actual master.'.format( + self.font.familyName, glyph.name, layer.layerId)) continue if not layer.name: # Empty layer names are invalid according to the UFO spec. - self.logger.warning( - '{}, glyph "{}": Contains layer without a name which will ' - 'be skipped.'.format(self.font.familyName, glyph.name)) + if self.minimize_glyphs_diffs: + self.logger.warning( + '{}, glyph "{}": Contains layer without a name which ' + 'will be skipped.'.format(self.font.familyName, + glyph.name)) continue ufo_layer = self.to_ufo_layer(glyph, layer) diff --git a/tests/builder/builder_test.py b/tests/builder/builder_test.py index <HASH>..<HASH> 100644 --- a/tests/builder/builder_test.py +++ b/tests/builder/builder_test.py @@ -1142,16 +1142,22 @@ class SkipDanglingAndNamelessLayers(unittest.TestCase): self.font.glyphs[0].layers[0].associatedMasterId = "xxx" with CapturingLogHandler(self.logger, level="WARNING") as captor: - to_ufos(self.font) + to_ufos(self.font, minimize_glyphs_diffs=True) captor.assertRegex("layer without a name") + # no warning if minimize_glyphs_diff=False + with CapturingLogHandler(self.logger, level="WARNING") as captor: + to_ufos(self.font, minimize_glyphs_diffs=False) + + self.assertFalse(captor.records) + def test_dangling_layer(self): self.font.glyphs[0].layers[0].layerId = "yyy" self.font.glyphs[0].layers[0].associatedMasterId = "xxx" with CapturingLogHandler(self.logger, level="WARNING") as captor: - to_ufos(self.font) + to_ufos(self.font, minimize_glyphs_diffs=True) captor.assertRegex("is dangling and will be skipped")
mute "layer without name" warning if minimize_glyphs_diff=False it can be very chatty, especially on some fonts which have tons of these <URL>
googlefonts_glyphsLib
train