def test_complex_upstream(self): inp_data = loads(TESTBLOCK_CASE_3) out_data = '\n' + dumps(inp_data) self.assertEqual(TESTBLOCK_CASE_3, out_data)
def test_quoted_key_value(self): data = loads(TESTBLOCK_CASE_2) out_data = '\n' + dumps(data) self.assertEqual(out_data, TESTBLOCK_CASE_2)
def test_upstream_count_section(self): data = loads(TESTBLOCK_CASE_1) self.assertEqual(len(data.filter('Upstream')), 3)
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, '')
def test_session_sticky(self): inp_data = loads(TESTBLOCK_CASE_4) out_data = '\n' + dumps(inp_data) self.assertEqual(TESTBLOCK_CASE_4, out_data)