Skip to content

Commit

Permalink
Fix spelling error and failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin-APNIC committed May 8, 2024
1 parent de1b869 commit aefdf74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/admins/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -777,20 +777,20 @@ Sources
that will contain the dummy data within the NRTMv3 responses.
IRRD will dummy an object class only if the ``nrtm_response_dummy_attributes``
is defined and the object class attribute keys are in the dummy attributes.
|br| **Default**: not defined, no objects dummyfied.
|br| **Default**: not defined, no objects dummied.
|br| **Change takes effect**: after SIGHUP, upon next request.
* ``sources.{name}.nrtm_response_dummy_attributes``: object attributes that contain
dummy data. This is a dictionary with the attribute keys and corresponding dummy
attribute string values.
The attributes will be replaced only if ``nrtm_response_dummy_object_class``
is defined and the attributes are in the defined object class.
If the attibute value has the ``%s``, IRRD will replace it by the object primary key,
If the attribute value has the ``%s``, IRRD will replace it by the object primary key,
e.g. ``person: Dummy name for %s``.

|br| **Default**: not defined. no objects dummyfied.
|br| **Default**: not defined. no objects dummied.
|br| **Change takes effect**: after SIGHUP, upon next request.
* ``sources.{name}.nrtm_response_dummy_remarks``: an additional remarks to be added
to the end of the dummyfied object in the NRTMv3 response.
to the end of the dummied object in the NRTMv3 response.
IRRD will only add the remarks to the object classes defined in the
``nrtm_response_dummy_object_class``.
This can have multiple lines. When adding this to the configuration,
Expand Down
12 changes: 6 additions & 6 deletions irrd/server/whois/tests/test_query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ def test_nrtm_request(self, prepare_parser, monkeypatch, config_override):
mock_nrg = Mock()
monkeypatch.setattr("irrd.server.whois.query_parser.NRTMGenerator", lambda: mock_nrg)
mock_nrg.generate = (
lambda source, version, serial_start, serial_end, dh, remove_auth_hashes: (
f"{source}/{version}/{serial_start}/{serial_end}/{remove_auth_hashes}"
lambda source, version, serial_start, serial_end, dh, remove_auth_hashes, dummify_object_text: (
f"{source}/{version}/{serial_start}/{serial_end}/{remove_auth_hashes}/{dummify_object_text}"
)
)

Expand All @@ -345,13 +345,13 @@ def test_nrtm_request(self, prepare_parser, monkeypatch, config_override):
response = parser.handle_query("-g TEST1:3:1-5")
assert response.response_type == WhoisQueryResponseType.SUCCESS
assert response.mode == WhoisQueryResponseMode.RIPE
assert response.result == "TEST1/3/1/5/True"
assert response.result == "TEST1/3/1/5/True/True"
assert not response.remove_auth_hashes

response = parser.handle_query("-g TEST1:3:1-LAST")
assert response.response_type == WhoisQueryResponseType.SUCCESS
assert response.mode == WhoisQueryResponseMode.RIPE
assert response.result == "TEST1/3/1/None/True"
assert response.result == "TEST1/3/1/None/True/True"
assert not response.remove_auth_hashes

config_override(
Expand All @@ -368,7 +368,7 @@ def test_nrtm_request(self, prepare_parser, monkeypatch, config_override):
response = parser.handle_query("-g TEST1:3:1-LAST")
assert response.response_type == WhoisQueryResponseType.SUCCESS
assert response.mode == WhoisQueryResponseMode.RIPE
assert response.result == "TEST1/3/1/None/False"
assert response.result == "TEST1/3/1/None/False/True"
assert not response.remove_auth_hashes

config_override(
Expand All @@ -388,7 +388,7 @@ def test_nrtm_request(self, prepare_parser, monkeypatch, config_override):
response = parser.handle_query("-g TEST1:3:1-LAST")
assert response.response_type == WhoisQueryResponseType.SUCCESS
assert response.mode == WhoisQueryResponseMode.RIPE
assert response.result == "TEST1/3/1/None/False"
assert response.result == "TEST1/3/1/None/False/True"
assert not response.remove_auth_hashes

response = parser.handle_query("-g TEST1:9:1-LAST")
Expand Down

0 comments on commit aefdf74

Please sign in to comment.