Пример #1
0
 def test_complex_upstream(self):
     inp_data = loads(TESTBLOCK_CASE_3)
     out_data = '\n' + dumps(inp_data)
     self.assertEqual(TESTBLOCK_CASE_3, out_data)
Пример #2
0
 def test_quoted_key_value(self):
     data = loads(TESTBLOCK_CASE_2)
     out_data = '\n' + dumps(data)
     self.assertEqual(out_data, TESTBLOCK_CASE_2)
Пример #3
0
 def test_upstream_count_section(self):
     data = loads(TESTBLOCK_CASE_1)
     self.assertEqual(len(data.filter('Upstream')), 3)
Пример #4
0
 def test_single_value_keys(self):
     data = loads(TESTBLOCK_CASE_1)
     single_value_key = data.filter('Upstream')[0].keys[0]
     self.assertEqual(single_value_key.name, 'ip_hash')
     self.assertEqual(single_value_key.value, '')
Пример #5
0
 def test_session_sticky(self):
     inp_data = loads(TESTBLOCK_CASE_4)
     out_data = '\n' + dumps(inp_data)
     self.assertEqual(TESTBLOCK_CASE_4, out_data)