def test_mapping_by_request_exact_match(self): w = Wiremock(host="localhost", port=8080) w.delete_all_mappings() self.assertEqual(len(w.populate_from_dir('./tests/mappings')), 2) # import pdb; pdb.set_trace() filter = {"method": "GET", "url": "/epg"} mapping = w.mapping_by_request_exact_match(filter) self.assertEqual(mapping['request'], filter)
def test_mapping_by_request(self): w = Wiremock(host="localhost", port=8080) w.delete_all_mappings() self.assertEqual(len(w.populate_from_dir('./tests/mappings')), 2) # import pdb; pdb.set_trace() filter = { "method": "GET", "url": "/epg", "queryParameters": { "episode_title": { "matches": "([a-z]*)" } } } mapping = w.mapping_by_request(filter) self.assertEqual(mapping['request'], filter)
def test_populate_from_dir(self): w = Wiremock(host="localhost", port=8080) w.delete_all_mappings() self.assertEqual(len(w.populate_from_dir('./tests/mappings')), 2) mappings = w.mappings() self.assertEqual(len(mappings), 2)