Skip to content

Commit

Permalink
send timezone for row preview, added backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wagner-intevation committed Jul 3, 2023
1 parent c66d830 commit 02094f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/components/WebinputCSV.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ export default ({
custom: this.computeCustom(),
dryrun: this.dryrun,
templates: this.mailgenTemplates,
timezone: this.timezone,
})
.then(response => {
response.json().then(data => {
Expand Down
21 changes: 21 additions & 0 deletions tests/test_bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,27 @@ def test_bots_library():
}]}


def test_bots_library_time():
"""
test /process with time-data
"""
with mock.patch('webinput_session.session.skip_authentication', new=True):
with mock.patch('intelmq_webinput_csv.serve.CONFIG', new=CONFIG | BOTS_CONFIG):
result = test.call('POST', intelmq_webinput_csv.serve, '/api/bots/process/', body={'data': [{'time.source': '2023-01-08 19:01:01'}],
'custom': {},
'dryrun': False,
'timezone': '+02:00'})
assert result.status == '200 OK'
del result.data['messages'][0]['time.observation']
assert 'RemoveAffixExpertBot initialized with id remove-affix' in result.data['log']
assert 'Bot initialization completed.' in result.data['log']
del result.data['log']
assert result.data == {'status': 'success',
'messages': [{'classification.identifier': 'test', 'classification.type': 'test',
'classification.taxonomy': 'test', 'feed.code': 'oneshot', 'feed.provider': 'my-organization',
'time.source': '2023-01-08T17:01:01+00:00'}]}


def test_bot_exception():
"""
When a bot raises an exception during Bot initialization
Expand Down

0 comments on commit 02094f8

Please sign in to comment.