Ejemplo n.º 1
0
 def test_create(self):
     list_id = "2983492834987394879837498"
     rulegroups = [{"Rules": [{"RuleType": "EmailAddress", "Clause": "CONTAINS example.com"},  {
         "RuleType": "Name", "Clause": "EQUALS subscriber"}]}]
     s = Segment()
     s.stub_request("segments/%s.json" % list_id, "create_segment.json", None,
                    "{\"RuleGroups\": [{\"Rules\": [{\"Clause\": \"CONTAINS example.com\", \"RuleType\": \"EmailAddress\"}, {\"Clause\": \"EQUALS subscriber\", \"RuleType\": \"Name\"}]}], \"Title\": \"new segment title\"}")
     segment_id = s.create(list_id, "new segment title", rulegroups)
     self.assertEquals(segment_id, "0246c2aea610a3545d9780bf6ab890061234")
     self.assertEquals(s.segment_id, "0246c2aea610a3545d9780bf6ab890061234")
 def test_create(self):
     list_id = "2983492834987394879837498"
     rulegroups = [{"Rules": [{"RuleType": "EmailAddress", "Clause": "CONTAINS example.com"},  {
         "RuleType": "Name", "Clause": "EQUALS subscriber"}]}]
     s = Segment()
     s.stub_request("segments/%s.json" % list_id, "create_segment.json", None,
                    "{\"RuleGroups\": [{\"Rules\": [{\"Clause\": \"CONTAINS example.com\", \"RuleType\": \"EmailAddress\"}, {\"Clause\": \"EQUALS subscriber\", \"RuleType\": \"Name\"}]}], \"Title\": \"new segment title\"}")
     segment_id = s.create(list_id, "new segment title", rulegroups)
     self.assertEquals(segment_id, "0246c2aea610a3545d9780bf6ab890061234")
     self.assertEquals(s.segment_id, "0246c2aea610a3545d9780bf6ab890061234")
Ejemplo n.º 3
0
 def setUp(self):
     self.segment_id = "98y2e98y289dh89h938389"
     self.segment = Segment(
         {
             "access_token": "ASP95S4aR+9KsgfHB0dapTYxNA==",
             "refresh_token": "5S4aASP9R+9KsgfHB0dapTYxNA=="
         }, self.segment_id)
Ejemplo n.º 4
0
 def setUp(self):
     self.segment_id = "98y2e98y289dh89h938389"
     self.segment = Segment(
         {'api_key': '123123123123123123123'}, self.segment_id)