本文整理匯總了Golang中github.com/motain/gocheck.Not函數的典型用法代碼示例。如果您正苦於以下問題:Golang Not函數的具體用法?Golang Not怎麽用?Golang Not使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Not函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestCreateLoadBalancer
func (s *S) TestCreateLoadBalancer(c *gocheck.C) {
testServer.PrepareResponse(200, nil, CreateLoadBalancer)
createLB := &elb.CreateLoadBalancer{
Name: "testlb",
AvailabilityZones: []string{"us-east-1a", "us-east-1b"},
Listeners: []elb.Listener{
{
InstancePort: 80,
InstanceProtocol: "http",
Protocol: "http",
LoadBalancerPort: 80,
},
},
}
resp, err := s.elb.CreateLoadBalancer(createLB)
c.Assert(err, gocheck.IsNil)
defer s.elb.DeleteLoadBalancer(createLB.Name)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Action"), gocheck.Equals, "CreateLoadBalancer")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("LoadBalancerName"), gocheck.Equals, "testlb")
c.Assert(values.Get("AvailabilityZones.member.1"), gocheck.Equals, "us-east-1a")
c.Assert(values.Get("AvailabilityZones.member.2"), gocheck.Equals, "us-east-1b")
c.Assert(values.Get("Listeners.member.1.InstancePort"), gocheck.Equals, "80")
c.Assert(values.Get("Listeners.member.1.InstanceProtocol"), gocheck.Equals, "http")
c.Assert(values.Get("Listeners.member.1.Protocol"), gocheck.Equals, "http")
c.Assert(values.Get("Listeners.member.1.LoadBalancerPort"), gocheck.Equals, "80")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(resp.DNSName, gocheck.Equals, "testlb-339187009.us-east-1.elb.amazonaws.com")
}
示例2: TestConfigureHealthCheck
func (s *S) TestConfigureHealthCheck(c *gocheck.C) {
testServer.PrepareResponse(200, nil, ConfigureHealthCheck)
hc := elb.HealthCheck{
HealthyThreshold: 10,
Interval: 30,
Target: "HTTP:80/",
Timeout: 5,
UnhealthyThreshold: 2,
}
resp, err := s.elb.ConfigureHealthCheck("testlb", &hc)
c.Assert(err, gocheck.IsNil)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "ConfigureHealthCheck")
c.Assert(values.Get("LoadBalancerName"), gocheck.Equals, "testlb")
c.Assert(values.Get("HealthCheck.HealthyThreshold"), gocheck.Equals, "10")
c.Assert(values.Get("HealthCheck.Interval"), gocheck.Equals, "30")
c.Assert(values.Get("HealthCheck.Target"), gocheck.Equals, "HTTP:80/")
c.Assert(values.Get("HealthCheck.Timeout"), gocheck.Equals, "5")
c.Assert(values.Get("HealthCheck.UnhealthyThreshold"), gocheck.Equals, "2")
c.Assert(resp.HealthCheck.HealthyThreshold, gocheck.Equals, 10)
c.Assert(resp.HealthCheck.Interval, gocheck.Equals, 30)
c.Assert(resp.HealthCheck.Target, gocheck.Equals, "HTTP:80/")
c.Assert(resp.HealthCheck.Timeout, gocheck.Equals, 5)
c.Assert(resp.HealthCheck.UnhealthyThreshold, gocheck.Equals, 2)
}
示例3: TestListPlatformApplications
func (s *S) TestListPlatformApplications(c *gocheck.C) {
testServer.Response(200, nil, TestListPlatformApplicationsXmlOK)
resp, err := s.sns.ListPlatformApplications("")
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(len(resp.PlatformApplications), gocheck.Not(gocheck.Equals), 0)
c.Assert(resp.PlatformApplications[0].PlatformApplicationArn, gocheck.Equals, "arn:aws:sns:us-west-2:123456789012:app/APNS_SANDBOX/apnspushapp")
c.Assert(len(resp.PlatformApplications[0].Attributes), gocheck.Equals, 1)
c.Assert(resp.PlatformApplications[0].Attributes[0].Key, gocheck.Equals, "AllowEndpointPolicies")
c.Assert(resp.PlatformApplications[0].Attributes[0].Value, gocheck.Equals, "false")
c.Assert(resp.PlatformApplications[1].PlatformApplicationArn, gocheck.Equals, "arn:aws:sns:us-west-2:123456789012:app/GCM/gcmpushapp")
c.Assert(len(resp.PlatformApplications[1].Attributes), gocheck.Equals, 1)
c.Assert(resp.PlatformApplications[1].Attributes[0].Key, gocheck.Equals, "AllowEndpointPolicies")
c.Assert(resp.PlatformApplications[1].Attributes[0].Value, gocheck.Equals, "false")
c.Assert(resp.RequestId, gocheck.Equals, "315a335e-85d8-52df-9349-791283cbb529")
c.Assert(err, gocheck.IsNil)
}
示例4: TestDescribeLoadBalancersByName
func (s *S) TestDescribeLoadBalancersByName(c *gocheck.C) {
testServer.PrepareResponse(200, nil, DescribeLoadBalancers)
s.elb.DescribeLoadBalancers("somelb")
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "DescribeLoadBalancers")
c.Assert(values.Get("LoadBalancerNames.member.1"), gocheck.Equals, "somelb")
}
示例5: TestDeleteLoadBalancer
func (s *S) TestDeleteLoadBalancer(c *gocheck.C) {
testServer.PrepareResponse(200, nil, DeleteLoadBalancer)
resp, err := s.elb.DeleteLoadBalancer("testlb")
c.Assert(err, gocheck.IsNil)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "DeleteLoadBalancer")
c.Assert(values.Get("LoadBalancerName"), gocheck.Equals, "testlb")
c.Assert(resp.RequestId, gocheck.Equals, "8d7223db-49d7-11e2-bba9-35ba56032fe1")
}
示例6: TestDescribeLoadBalancers
func (s *S) TestDescribeLoadBalancers(c *gocheck.C) {
testServer.PrepareResponse(200, nil, DescribeLoadBalancers)
resp, err := s.elb.DescribeLoadBalancers()
c.Assert(err, gocheck.IsNil)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "DescribeLoadBalancers")
t, _ := time.Parse(time.RFC3339, "2012-12-27T11:51:52.970Z")
expected := &elb.DescribeLoadBalancerResp{
[]elb.LoadBalancerDescription{
{
AvailabilityZones: []string{"us-east-1a"},
BackendServerDescriptions: []elb.BackendServerDescriptions(nil),
CanonicalHostedZoneName: "testlb-2087227216.us-east-1.elb.amazonaws.com",
CanonicalHostedZoneNameId: "Z3DZXE0Q79N41H",
CreatedTime: t,
DNSName: "testlb-2087227216.us-east-1.elb.amazonaws.com",
HealthCheck: elb.HealthCheck{
HealthyThreshold: 10,
Interval: 30,
Target: "TCP:80",
Timeout: 5,
UnhealthyThreshold: 2,
},
Instances: []elb.Instance(nil),
ListenerDescriptions: []elb.ListenerDescription{
{
Listener: elb.Listener{
Protocol: "HTTP",
LoadBalancerPort: 80,
InstanceProtocol: "HTTP",
InstancePort: 80,
},
},
},
LoadBalancerName: "testlb",
//Policies: elb.Policies(nil),
Scheme: "internet-facing",
SecurityGroups: []string(nil),
SourceSecurityGroup: elb.SourceSecurityGroup{
GroupName: "amazon-elb-sg",
OwnerAlias: "amazon-elb",
},
Subnets: []string(nil),
},
},
}
c.Assert(resp, gocheck.DeepEquals, expected)
}
示例7: TestRegisterInstancesWithLoadBalancer
func (s *S) TestRegisterInstancesWithLoadBalancer(c *gocheck.C) {
testServer.PrepareResponse(200, nil, RegisterInstancesWithLoadBalancer)
resp, err := s.elb.RegisterInstancesWithLoadBalancer([]string{"i-b44db8ca", "i-461ecf38"}, "testlb")
c.Assert(err, gocheck.IsNil)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "RegisterInstancesWithLoadBalancer")
c.Assert(values.Get("LoadBalancerName"), gocheck.Equals, "testlb")
c.Assert(values.Get("Instances.member.1.InstanceId"), gocheck.Equals, "i-b44db8ca")
c.Assert(values.Get("Instances.member.2.InstanceId"), gocheck.Equals, "i-461ecf38")
c.Assert(resp.InstanceIds, gocheck.DeepEquals, []string{"i-b44db8ca", "i-461ecf38"})
}
示例8: TestDeregisterInstancesFromLoadBalancer
func (s *S) TestDeregisterInstancesFromLoadBalancer(c *gocheck.C) {
testServer.PrepareResponse(200, nil, DeregisterInstancesFromLoadBalancer)
resp, err := s.elb.DeregisterInstancesFromLoadBalancer([]string{"i-b44db8ca", "i-461ecf38"}, "testlb")
c.Assert(err, gocheck.IsNil)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "DeregisterInstancesFromLoadBalancer")
c.Assert(values.Get("LoadBalancerName"), gocheck.Equals, "testlb")
c.Assert(values.Get("Instances.member.1.InstanceId"), gocheck.Equals, "i-b44db8ca")
c.Assert(values.Get("Instances.member.2.InstanceId"), gocheck.Equals, "i-461ecf38")
c.Assert(resp.RequestId, gocheck.Equals, "d6490837-49fd-11e2-bba9-35ba56032fe1")
}
示例9: TestListQueues
func (s *S) TestListQueues(c *gocheck.C) {
testServer.PrepareResponse(200, nil, TestListQueuesXmlOK)
resp, err := s.sqs.ListQueues("")
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(len(resp.QueueUrl), gocheck.Not(gocheck.Equals), 0)
c.Assert(resp.QueueUrl[0], gocheck.Equals, "http://sqs.us-east-1.amazonaws.com/123456789012/testQueue")
c.Assert(resp.ResponseMetadata.RequestId, gocheck.Equals, "725275ae-0b9b-4762-b238-436d7c65a1ac")
c.Assert(err, gocheck.IsNil)
}
示例10: TestAttrsSelectOK
func (s *S) TestAttrsSelectOK(c *gocheck.C) {
testServer.Response(200, nil, TestAttrsXmlOK)
domain := s.sdb.Domain("MyDomain")
item := domain.Item("Item123")
resp, err := item.Attrs([]string{"Color", "Size"}, true)
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(req.Form["Action"], gocheck.DeepEquals, []string{"GetAttributes"})
c.Assert(req.Form["ItemName"], gocheck.DeepEquals, []string{"Item123"})
c.Assert(req.Form["DomainName"], gocheck.DeepEquals, []string{"MyDomain"})
c.Assert(req.Form["ConsistentRead"], gocheck.DeepEquals, []string{"true"})
c.Assert(req.Form["AttributeName.1"], gocheck.DeepEquals, []string{"Color"})
c.Assert(req.Form["AttributeName.2"], gocheck.DeepEquals, []string{"Size"})
c.Assert(resp.Attrs[0].Name, gocheck.Equals, "Color")
c.Assert(resp.Attrs[0].Value, gocheck.Equals, "Blue")
c.Assert(resp.Attrs[1].Name, gocheck.Equals, "Size")
c.Assert(resp.Attrs[1].Value, gocheck.Equals, "Med")
c.Assert(resp.ResponseMetadata.RequestId, gocheck.Equals, "b1e8f1f7-42e9-494c-ad09-2674e557526d")
c.Assert(resp.ResponseMetadata.BoxUsage, gocheck.Equals, 0.0000219942)
c.Assert(err, gocheck.IsNil)
}
示例11: TestListWithDelimiter
func (s *S) TestListWithDelimiter(c *gocheck.C) {
testServer.Response(200, nil, GetListResultDump2)
b := s.s3.Bucket("quotes")
data, err := b.List("photos/2006/", "/", "some-marker", 1000)
c.Assert(err, gocheck.IsNil)
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/quotes/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(req.Form["prefix"], gocheck.DeepEquals, []string{"photos/2006/"})
c.Assert(req.Form["delimiter"], gocheck.DeepEquals, []string{"/"})
c.Assert(req.Form["marker"], gocheck.DeepEquals, []string{"some-marker"})
c.Assert(req.Form["max-keys"], gocheck.DeepEquals, []string{"1000"})
c.Assert(data.Name, gocheck.Equals, "example-bucket")
c.Assert(data.Prefix, gocheck.Equals, "photos/2006/")
c.Assert(data.Delimiter, gocheck.Equals, "/")
c.Assert(data.Marker, gocheck.Equals, "some-marker")
c.Assert(data.IsTruncated, gocheck.Equals, false)
c.Assert(len(data.Contents), gocheck.Equals, 0)
c.Assert(data.CommonPrefixes, gocheck.DeepEquals, []string{"photos/2006/feb/", "photos/2006/jan/"})
}
示例12: TestGetPlatformApplicationAttributes
func (s *S) TestGetPlatformApplicationAttributes(c *gocheck.C) {
testServer.Response(200, nil, TestGetPlatformApplicationAttributesXmlOK)
resp, err := s.sns.GetPlatformApplicationAttributes("arn:aws:sns:us-west-2:123456789012:app/GCM/gcmpushapp", "")
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(len(resp.Attributes), gocheck.Not(gocheck.Equals), 0)
c.Assert(resp.Attributes[0].Key, gocheck.Equals, "AllowEndpointPolicies")
c.Assert(resp.Attributes[0].Value, gocheck.Equals, "false")
c.Assert(resp.RequestId, gocheck.Equals, "74848df2-87f6-55ed-890c-c7be80442462")
c.Assert(err, gocheck.IsNil)
}
示例13: TestDescribeInstanceHealth
func (s *S) TestDescribeInstanceHealth(c *gocheck.C) {
testServer.PrepareResponse(200, nil, DescribeInstanceHealth)
resp, err := s.elb.DescribeInstanceHealth("testlb", "i-b44db8ca")
c.Assert(err, gocheck.IsNil)
values := testServer.WaitRequest().URL.Query()
c.Assert(values.Get("Version"), gocheck.Equals, "2012-06-01")
c.Assert(values.Get("Signature"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Timestamp"), gocheck.Not(gocheck.Equals), "")
c.Assert(values.Get("Action"), gocheck.Equals, "DescribeInstanceHealth")
c.Assert(values.Get("LoadBalancerName"), gocheck.Equals, "testlb")
c.Assert(values.Get("Instances.member.1.InstanceId"), gocheck.Equals, "i-b44db8ca")
c.Assert(len(resp.InstanceStates) > 0, gocheck.Equals, true)
c.Assert(resp.InstanceStates[0].Description, gocheck.Equals, "Instance registration is still in progress.")
c.Assert(resp.InstanceStates[0].InstanceId, gocheck.Equals, "i-b44db8ca")
c.Assert(resp.InstanceStates[0].State, gocheck.Equals, "OutOfService")
c.Assert(resp.InstanceStates[0].ReasonCode, gocheck.Equals, "ELB")
}
示例14: TestListSubscriptions
func (s *S) TestListSubscriptions(c *gocheck.C) {
testServer.Response(200, nil, TestListSubscriptionsXmlOK)
resp, err := s.sns.ListSubscriptions(nil)
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(len(resp.Subscriptions), gocheck.Not(gocheck.Equals), 0)
c.Assert(resp.Subscriptions[0].Protocol, gocheck.Equals, "email")
c.Assert(resp.Subscriptions[0].Endpoint, gocheck.Equals, "[email protected]")
c.Assert(resp.Subscriptions[0].SubscriptionArn, gocheck.Equals, "arn:aws:sns:us-east-1:123456789012:My-Topic:80289ba6-0fd4-4079-afb4-ce8c8260f0ca")
c.Assert(resp.Subscriptions[0].TopicArn, gocheck.Equals, "arn:aws:sns:us-east-1:698519295917:My-Topic")
c.Assert(resp.Subscriptions[0].Owner, gocheck.Equals, "123456789012")
c.Assert(err, gocheck.IsNil)
}
示例15: TestGetTopicAttributes
func (s *S) TestGetTopicAttributes(c *gocheck.C) {
testServer.Response(200, nil, TestGetTopicAttributesXmlOK)
resp, err := s.sns.GetTopicAttributes("arn:aws:sns:us-east-1:123456789012:My-Topic")
req := testServer.WaitRequest()
c.Assert(req.Method, gocheck.Equals, "GET")
c.Assert(req.URL.Path, gocheck.Equals, "/")
c.Assert(req.Header["Date"], gocheck.Not(gocheck.Equals), "")
c.Assert(len(resp.Attributes), gocheck.Not(gocheck.Equals), 0)
c.Assert(resp.Attributes[0].Key, gocheck.Equals, "Owner")
c.Assert(resp.Attributes[0].Value, gocheck.Equals, "123456789012")
c.Assert(resp.Attributes[1].Key, gocheck.Equals, "Policy")
c.Assert(resp.Attributes[1].Value, gocheck.Equals, `{"Version":"2008-10-17","Id":"us-east-1/698519295917/test__default_policy_ID","Statement" : [{"Effect":"Allow","Sid":"us-east-1/698519295917/test__default_statement_ID","Principal" : {"AWS": "*"},"Action":["SNS:GetTopicAttributes","SNS:SetTopicAttributes","SNS:AddPermission","SNS:RemovePermission","SNS:DeleteTopic","SNS:Subscribe","SNS:ListSubscriptionsByTopic","SNS:Publish","SNS:Receive"],"Resource":"arn:aws:sns:us-east-1:698519295917:test","Condition" : {"StringLike" : {"AWS:SourceArn": "arn:aws:*:*:698519295917:*"}}}]}`)
c.Assert(resp.ResponseMetadata.RequestId, gocheck.Equals, "057f074c-33a7-11df-9540-99d0768312d3")
c.Assert(err, gocheck.IsNil)
}