aa-intel-tool 2.10.1__py3-none-any.whl → 2.11.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_intel_tool/__init__.py +1 -1
- aa_intel_tool/auth_hooks.py +2 -2
- aa_intel_tool/locale/cs_CZ/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/de/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/django.pot +5 -5
- aa_intel_tool/locale/es/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/fr_FR/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/it_IT/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/ja/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/ja/LC_MESSAGES/django.po +35 -35
- aa_intel_tool/locale/ko_KR/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/nl_NL/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/pl_PL/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/ru/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/sk/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/uk/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/locale/zh_Hans/LC_MESSAGES/django.po +4 -4
- aa_intel_tool/parser/module/dscan.py +4 -5
- aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.css +23 -26
- aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.min.css +1 -1
- aa_intel_tool/static/aa_intel_tool/css/aa-intel-tool.min.css.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.js +169 -282
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-chatscan.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.js +251 -572
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-dscan.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-fleetcomposition.js +163 -237
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-fleetcomposition.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-fleetcomposition.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-scan-result-common.js +18 -0
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-scan-result-common.min.js +1 -1
- aa_intel_tool/static/aa_intel_tool/javascript/aa-intel-tool-scan-result-common.min.js.map +1 -1
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/dataTables.bootstrap5.css +610 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/dataTables.bootstrap5.js +123 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/dataTables.bootstrap5.min.css +8 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/dataTables.bootstrap5.min.css.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/dataTables.bootstrap5.min.js +6 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/dataTables.bootstrap5.min.js.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/datatables.min.js +10 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/2.3.4/datatables.min.js.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/css/columnControl.bootstrap5.css +516 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/css/columnControl.bootstrap5.min.css +2 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/css/columnControl.bootstrap5.min.css.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/js/columnControl.bootstrap5.js +73 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/js/columnControl.bootstrap5.min.js +6 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/js/columnControl.bootstrap5.min.js.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/js/dataTables.columnControl.js +3091 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/js/dataTables.columnControl.min.js +10 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/ColumnControl/1.1.1/js/dataTables.columnControl.min.js.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/css/fixedHeader.bootstrap5.css +20 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/css/fixedHeader.bootstrap5.min.css +2 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/css/fixedHeader.bootstrap5.min.css.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/js/dataTables.fixedHeader.js +1203 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/js/dataTables.fixedHeader.min.js +6 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/js/dataTables.fixedHeader.min.js.map +1 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/js/fixedHeader.bootstrap5.js +59 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/js/fixedHeader.bootstrap5.min.js +6 -0
- aa_intel_tool/static/aa_intel_tool/libs/DataTables/Extensions/FixedHeader/4.0.4/js/fixedHeader.bootstrap5.min.js.map +1 -0
- aa_intel_tool/templates/aa_intel_tool/base.html +30 -0
- aa_intel_tool/templates/aa_intel_tool/bundles/datatables-2-css.html +11 -0
- aa_intel_tool/templates/aa_intel_tool/bundles/datatables-2-js.html +14 -0
- aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/alliances.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/corporations.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/chatlist/pilots.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/interesting-on-grid/items.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown/ship-classes.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/dscan/ships-breakdown/ship-types.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/partials/scan/fleetcomp/fleet-details/pilots.html +1 -1
- aa_intel_tool/templates/aa_intel_tool/views/scan/chatlist.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/views/scan/dscan.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/views/scan/fleetcomp.html +2 -2
- aa_intel_tool/tests/__init__.py +38 -0
- aa_intel_tool/tests/test_access.py +2 -2
- aa_intel_tool/tests/test_admin.py +4 -3
- aa_intel_tool/tests/test_app_settings.py +3 -2
- aa_intel_tool/tests/test_auth_hooks.py +2 -2
- aa_intel_tool/tests/test_helper_data_structures.py +2 -4
- aa_intel_tool/tests/test_helper_eve_character.py +5 -7
- aa_intel_tool/tests/test_models.py +3 -3
- aa_intel_tool/tests/test_parser_general.py +48 -34
- aa_intel_tool/tests/test_parser_helper_db.py +2 -4
- aa_intel_tool/tests/test_parser_module_chatlist.py +2 -2
- aa_intel_tool/tests/test_parser_module_dscan.py +828 -0
- aa_intel_tool/tests/test_parser_module_feetcomp.py +230 -0
- aa_intel_tool/tests/test_tasks.py +56 -0
- aa_intel_tool/tests/test_views_ajax.py +72 -0
- aa_intel_tool/tests/test_views_general.py +240 -0
- {aa_intel_tool-2.10.1.dist-info → aa_intel_tool-2.11.1.dist-info}/METADATA +1 -1
- {aa_intel_tool-2.10.1.dist-info → aa_intel_tool-2.11.1.dist-info}/RECORD +92 -59
- {aa_intel_tool-2.10.1.dist-info → aa_intel_tool-2.11.1.dist-info}/WHEEL +0 -0
- {aa_intel_tool-2.10.1.dist-info → aa_intel_tool-2.11.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -5,9 +5,6 @@ Testing the parsers
|
|
|
5
5
|
# Standard Library
|
|
6
6
|
from unittest.mock import MagicMock, patch
|
|
7
7
|
|
|
8
|
-
# Django
|
|
9
|
-
from django.test import TestCase
|
|
10
|
-
|
|
11
8
|
# Alliance Auth (External Libs)
|
|
12
9
|
from eveuniverse.models import EveEntity
|
|
13
10
|
|
|
@@ -22,6 +19,7 @@ from aa_intel_tool.parser.module.chatlist import (
|
|
|
22
19
|
_parse_chatscan_data,
|
|
23
20
|
_parse_corporation_info,
|
|
24
21
|
)
|
|
22
|
+
from aa_intel_tool.tests import BaseTestCase
|
|
25
23
|
from aa_intel_tool.tests.utils import (
|
|
26
24
|
load_chatscan_faulty_txt,
|
|
27
25
|
load_chatscan_txt,
|
|
@@ -30,7 +28,7 @@ from aa_intel_tool.tests.utils import (
|
|
|
30
28
|
)
|
|
31
29
|
|
|
32
30
|
|
|
33
|
-
class TestCheckIntelType(
|
|
31
|
+
class TestCheckIntelType(BaseTestCase):
|
|
34
32
|
"""
|
|
35
33
|
Test the check_intel_type function
|
|
36
34
|
"""
|
|
@@ -96,7 +94,7 @@ class TestCheckIntelType(TestCase):
|
|
|
96
94
|
scan_data = str(form_data).splitlines()
|
|
97
95
|
|
|
98
96
|
expected_exception = ParserError
|
|
99
|
-
expected_message = "A parser error occurred » No suitable parser found. Input is not a supported intel type or malformed …"
|
|
97
|
+
expected_message = "A parser error occurred » No suitable parser found. Input is not a supported intel type or malformed …"
|
|
100
98
|
|
|
101
99
|
with self.assertRaises(expected_exception=expected_exception):
|
|
102
100
|
check_intel_type(scan_data=scan_data)
|
|
@@ -117,7 +115,7 @@ class TestCheckIntelType(TestCase):
|
|
|
117
115
|
form_data = load_chatscan_faulty_txt()
|
|
118
116
|
|
|
119
117
|
expected_exception = ParserError
|
|
120
|
-
expected_message = "A parser error occurred » No suitable parser found. Input is not a supported intel type or malformed …"
|
|
118
|
+
expected_message = "A parser error occurred » No suitable parser found. Input is not a supported intel type or malformed …"
|
|
121
119
|
|
|
122
120
|
with self.assertRaises(ParserError):
|
|
123
121
|
parse_intel(form_data=form_data)
|
|
@@ -149,7 +147,7 @@ class TestCheckIntelType(TestCase):
|
|
|
149
147
|
parse_intel(form_data=form_data)
|
|
150
148
|
|
|
151
149
|
|
|
152
|
-
class TestParseIntel(
|
|
150
|
+
class TestParseIntel(BaseTestCase):
|
|
153
151
|
"""
|
|
154
152
|
Test the parse_intel function
|
|
155
153
|
"""
|
|
@@ -248,7 +246,7 @@ class TestParseIntel(TestCase):
|
|
|
248
246
|
parse_intel(form_data)
|
|
249
247
|
|
|
250
248
|
|
|
251
|
-
class TestParseChatScanData(
|
|
249
|
+
class TestParseChatScanData(BaseTestCase):
|
|
252
250
|
"""
|
|
253
251
|
Test the _parse_chatscan_data function
|
|
254
252
|
"""
|
|
@@ -406,7 +404,7 @@ class TestParseChatScanData(TestCase):
|
|
|
406
404
|
self.assertEqual(result["corporations"][1]["count"], 1)
|
|
407
405
|
|
|
408
406
|
|
|
409
|
-
class TestParseCharacterInfo(
|
|
407
|
+
class TestParseCharacterInfo(BaseTestCase):
|
|
410
408
|
"""
|
|
411
409
|
Test the _parse_character_info function
|
|
412
410
|
"""
|
|
@@ -472,7 +470,7 @@ class TestParseCharacterInfo(TestCase):
|
|
|
472
470
|
self.assertEqual(result["alliance"]["name"], "Unaffiliated")
|
|
473
471
|
|
|
474
472
|
|
|
475
|
-
class TestParseCorporationInfo(
|
|
473
|
+
class TestParseCorporationInfo(BaseTestCase):
|
|
476
474
|
"""
|
|
477
475
|
Test the _parse_corporation_info function
|
|
478
476
|
"""
|
|
@@ -528,7 +526,7 @@ class TestParseCorporationInfo(TestCase):
|
|
|
528
526
|
self.assertNotIn("alliance", result)
|
|
529
527
|
|
|
530
528
|
|
|
531
|
-
class TestParseAllianceInfo(
|
|
529
|
+
class TestParseAllianceInfo(BaseTestCase):
|
|
532
530
|
"""
|
|
533
531
|
Test the _parse_alliance_info function
|
|
534
532
|
"""
|
|
@@ -623,7 +621,7 @@ class TestParseAllianceInfo(TestCase):
|
|
|
623
621
|
self.assertNotIn("zkillboard", result)
|
|
624
622
|
|
|
625
623
|
|
|
626
|
-
class TestGetUnaffiliatedAllianceInfo(
|
|
624
|
+
class TestGetUnaffiliatedAllianceInfo(BaseTestCase):
|
|
627
625
|
"""
|
|
628
626
|
Test the _get_unaffiliated_alliance_info function
|
|
629
627
|
"""
|
|
@@ -667,39 +665,55 @@ class TestGetUnaffiliatedAllianceInfo(TestCase):
|
|
|
667
665
|
self.assertEqual(result["logo"], "mock_logo_url")
|
|
668
666
|
|
|
669
667
|
|
|
670
|
-
class TestGetCharacterInfo(
|
|
668
|
+
class TestGetCharacterInfo(BaseTestCase):
|
|
671
669
|
"""
|
|
672
670
|
Test the _get_character_info function
|
|
673
671
|
"""
|
|
674
672
|
|
|
675
|
-
|
|
676
|
-
@patch("aa_intel_tool.parser.module.chatlist.get_or_create_character")
|
|
677
|
-
def test_returns_existing_characters(self, mock_get_or_create, mock_filter):
|
|
673
|
+
def test_returns_existing_characters(self):
|
|
678
674
|
"""
|
|
679
675
|
Test should return existing characters from the database
|
|
680
676
|
|
|
681
|
-
:param mock_get_or_create:
|
|
682
|
-
:type mock_get_or_create:
|
|
683
|
-
:param mock_filter:
|
|
684
|
-
:type mock_filter:
|
|
685
677
|
:return:
|
|
686
678
|
:rtype:
|
|
687
679
|
"""
|
|
688
680
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
681
|
+
with (
|
|
682
|
+
patch(
|
|
683
|
+
"aa_intel_tool.parser.module.chatlist.EveEntity.objects.fetch_by_names_esi"
|
|
684
|
+
) as mock_fetch,
|
|
685
|
+
patch(
|
|
686
|
+
"aa_intel_tool.parser.module.chatlist.EveCharacter.objects.filter"
|
|
687
|
+
) as mock_filter,
|
|
688
|
+
patch(
|
|
689
|
+
"aa_intel_tool.parser.module.chatlist.get_or_create_character"
|
|
690
|
+
) as mock_get_or_create,
|
|
691
|
+
):
|
|
692
|
+
# Simulate ESI returning two IDs
|
|
693
|
+
mock_fetch.return_value.filter.return_value.values_list.return_value = [
|
|
694
|
+
1,
|
|
695
|
+
2,
|
|
696
|
+
]
|
|
697
|
+
|
|
698
|
+
# Provide a QuerySet-like mock for EveCharacter.objects.filter(...)
|
|
699
|
+
qs = MagicMock()
|
|
700
|
+
char1 = MagicMock(character_name="Character1")
|
|
701
|
+
char2 = MagicMock(character_name="Character2")
|
|
702
|
+
qs.__iter__.return_value = [char1, char2]
|
|
703
|
+
qs.exclude.return_value = qs
|
|
704
|
+
mock_filter.return_value = qs
|
|
705
|
+
|
|
706
|
+
# Ensure chatlist's get_or_create_character (patched) returns the mocked characters
|
|
707
|
+
mock_get_or_create.return_value = [char1, char2]
|
|
708
|
+
|
|
709
|
+
result = _get_character_info(["Character1", "Character2"])
|
|
710
|
+
|
|
711
|
+
self.assertEqual(len(result), 2)
|
|
712
|
+
names = [
|
|
713
|
+
getattr(c, "character_name", getattr(c, "name", str(c))) for c in result
|
|
714
|
+
]
|
|
715
|
+
self.assertIn("Character1", names)
|
|
716
|
+
self.assertIn("Character2", names)
|
|
703
717
|
|
|
704
718
|
@patch("aa_intel_tool.parser.module.chatlist.EveCharacter.objects.filter")
|
|
705
719
|
def test_fetches_characters_from_eveuniverse(self, mock_filter):
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
Tests for the parsers' DB helper => aa_intel_tool/parser/helper/db.py
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
# Django
|
|
6
|
-
from django.test import TestCase
|
|
7
|
-
|
|
8
5
|
# AA Intel Tool
|
|
9
6
|
from aa_intel_tool.models import Scan, ScanData
|
|
10
7
|
from aa_intel_tool.parser.helper.db import safe_scan_to_db
|
|
8
|
+
from aa_intel_tool.tests import BaseTestCase
|
|
11
9
|
|
|
12
10
|
|
|
13
|
-
class TestParserHelperDb(
|
|
11
|
+
class TestParserHelperDb(BaseTestCase):
|
|
14
12
|
"""
|
|
15
13
|
The tests
|
|
16
14
|
"""
|
|
@@ -3,16 +3,16 @@ Test cases for the chatlist parser module.
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
# Standard Library
|
|
6
|
-
from unittest import TestCase
|
|
7
6
|
from unittest.mock import MagicMock, patch
|
|
8
7
|
|
|
9
8
|
# AA Intel Tool
|
|
10
9
|
from aa_intel_tool.exceptions import ParserError
|
|
11
10
|
from aa_intel_tool.models import Scan
|
|
12
11
|
from aa_intel_tool.parser.module.chatlist import parse
|
|
12
|
+
from aa_intel_tool.tests import BaseTestCase
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class TestParse(
|
|
15
|
+
class TestParse(BaseTestCase):
|
|
16
16
|
"""
|
|
17
17
|
Test cases for the parse function in the chatlist module.
|
|
18
18
|
"""
|