'If a rule doesn\'t have a hostname
- the passed hostname is added.
- the replacement is prefixed with the common prefix.'

@given(hostname=text(), replace=sampled_from(['replace_key', 'replace_key_prefix']))
def test_add_hostname(self, hostname, replace):

    rules = parse_routing_rules({'prefix/': {'key/': {replace: 'replacement'}}}, hostname)
    self.assertThat(rules, MatchesRoutingRules([RoutingRule.when(key_prefix='prefix/key/').then_redirect(hostname=hostname, protocol='https', http_redirect_code=302, **{replace: 'prefix/replacement'})]))
