Пример #1
0
 def test_should_error_when_key_duplicate(self):
     with self.assertRaises(ValueError):
         GraphDatabase._parse_routing_context("name=molly&name=white")
Пример #2
0
 def test_should_error_when_value_missing(self):
     with self.assertRaises(ValueError):
         GraphDatabase._parse_routing_context("name=&color=white")
Пример #3
0
 def verify_routing_context(self, expected, query):
     context = GraphDatabase._parse_routing_context(query)
     self.assertEqual(context, expected)
def test_graphdatabase_parse_routing_context_should_error_when_key_duplicate():
    # python -m pytest tests/unit/test_addressing.py -s -k test_graphdatabase_parse_routing_context_should_error_when_key_duplicate
    with pytest.raises(ValueError):
        GraphDatabase._parse_routing_context("name=molly&name=white")
def test_graphdatabase_parse_routing_context_should_error_when_value_missing():
    # python -m pytest tests/unit/test_addressing.py -s -k test_graphdatabase_parse_routing_context_should_error_when_value_missing
    with pytest.raises(ValueError):
        GraphDatabase._parse_routing_context("name=&color=white")
def test_graphdatabase_parse_routing_context():
    # python -m pytest tests/unit/test_addressing.py -s -k test_graphdatabase_parse_routing_context
    context = GraphDatabase._parse_routing_context(
        query="name=molly&color=white")
    assert context == {"name": "molly", "color": "white"}