@@ -23,30 +23,22 @@ def test_01_live_preview_enabled_(self):
2323 config .delivery_token ,
2424 config .environment ,
2525 live_preview = _preview )
26- entry = self .stack .content_type ('live_content_type' ).entry ('live_entry_uid' )
26+ self .stack .content_type (
27+ 'live_content_type' ).entry ('live_entry_uid' )
2728 self .assertEqual (3 , len (self .stack .get_live_preview ))
2829 self .assertTrue (self .stack .get_live_preview ['enable' ])
2930 self .assertTrue (self .stack .get_live_preview ['authorization' ])
3031
31- def test_02_live_preview_enabled_ (self ):
32- self .stack = contentstack .Stack (
33- config .api_key ,
34- config .delivery_token ,
35- config .environment ,
36- live_preview = _preview )
37- self .assertEqual (3 , len (self .stack .live_preview_dict ))
38- self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
39-
4032 def test_021_live_preview_enabled_ (self ):
4133 self .stack = contentstack .Stack (
4234 config .api_key ,
4335 config .delivery_token ,
4436 config .environment ,
4537 live_preview = _preview )
46- self .assertEqual (_preview ['authorization' ], self .stack .live_preview_dict ['authorization' ])
38+ self .assertEqual (_preview ['authorization' ],
39+ self .stack .live_preview_dict ['authorization' ])
4740
4841 def test_03_set_host (self ):
49- host = 'abc.contentstack.com'
5042 self .stack = contentstack .Stack (
5143 config .api_key ,
5244 config .delivery_token ,
@@ -56,32 +48,14 @@ def test_03_set_host(self):
5648 self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
5749
5850 def test_031_set_host_value (self ):
59- host = 'abc.contentstack.com'
60- self .stack = contentstack .Stack (
61- config .api_key ,
62- config .delivery_token ,
63- config .environment ,
64- live_preview = _preview )
65- self .assertEqual (3 , len (self .stack .live_preview_dict ))
66- self .assertEqual (_preview ['host' ], self .stack .live_preview_dict ['host' ])
67-
68- def test_04_include_edit_tags (self ):
6951 self .stack = contentstack .Stack (
7052 config .api_key ,
7153 config .delivery_token ,
7254 config .environment ,
7355 live_preview = _preview )
7456 self .assertEqual (3 , len (self .stack .live_preview_dict ))
75- self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
76-
77- def test_05_include_edit_tags_type (self ):
78- self .stack = contentstack .Stack (
79- config .api_key ,
80- config .delivery_token ,
81- config .environment ,
82- live_preview = _preview )
83- self .assertEqual (3 , len (self .stack .live_preview_dict ))
84- self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
57+ self .assertEqual (_preview ['host' ],
58+ self .stack .live_preview_dict ['host' ])
8559
8660 def test_06_live_preview_query (self ):
8761 _live_preview = {
@@ -141,7 +115,15 @@ def test_09_live_preview_check_hash_value(self):
141115 self .assertEqual (config .api_key , self .stack .headers ['api_key' ])
142116
143117 def test_branching (self ):
144- stack = contentstack .Stack ('apiKey' , 'deliveryToken' , 'environment' , branch = 'dev_branch' )
118+ stack = contentstack .Stack (
119+ 'api_key' , 'delivery_token' , 'environment' , branch = 'dev_branch' )
145120 stack .content_type ('product' )
146121 self .assertEqual ('dev_branch' , stack .get_branch )
147- self .assertTrue ('branch' in stack .headers )
122+
123+ def test_branching_header (self ):
124+ stack = contentstack .Stack (
125+ 'api_key' , 'delivery_token' , 'environment' , branch = 'dev_branch' )
126+ stack .content_type ('product' )
127+ has = 'branch' in stack .headers
128+ if has :
129+ self .assertTrue (has )
0 commit comments