Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 12 .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
with:
path: code42cli
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: pip install tox==3.17.1
run: |
pip install tox==3.17.1
pip install .
- name: Run Unit tests
run: cd code42cli; tox -e py # Run tox using the version of Python in `PATH`
run: tox -e py # Run tox using the version of Python in `PATH`
- name: Submit coverage report
uses: codecov/codecov-action@v1.0.7
with:
Expand Down Expand Up @@ -56,4 +56,4 @@ jobs:
- name: Start up the mock servers
run: cd code42-mock-servers; docker-compose up -d --build
- name: Run the integration tests
run: sleep 15; cd code42cli; tox -e integration
run: sleep 15; tox -e integration
4 changes: 3 additions & 1 deletion 4 .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
with:
python-version: '3.x'
- name: Install tox
run: pip install tox==3.17.1
run: |
pip install tox==3.17.1
pip install .
- name: Build docs
run: tox -e docs
2 changes: 1 addition & 1 deletion 2 .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 3 additions & 1 deletion 4 .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
with:
python-version: '3.x'
- name: Install tox
run: pip install tox==3.17.1
run: |
pip install tox==3.17.1
pip install .
- name: Run style checks
run: tox -e style
2 changes: 1 addition & 1 deletion 2 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 3.8.3
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
2 changes: 2 additions & 0 deletions 2 setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ ignore =
B904
# manual quoting
B907
# assertRaises-type
B908
# up to 88 allowed by bugbear B950
max-line-length = 80
4 changes: 3 additions & 1 deletion 4 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@
"ipython>=8.10.0;python_version>='3.8'",
"pandas>=1.1.3",
"py42>=1.26.0",
"setuptools>=66.0.0",
],
extras_require={
"dev": [
"flake8==3.8.3",
"flake8>=4.0.0",
"pytest==4.6.11",
"pytest-cov==2.10.0",
"pytest-mock==2.0.0",
"tox>=3.17.1",
"importlib-metadata<5.0",
],
"docs": [
"sphinx==4.4.0",
Expand Down
10 changes: 4 additions & 6 deletions 10 tests/logger/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,21 @@ def test_get_logger_for_server_when_given_cef_format_uses_cef_formatter():
logger = get_logger_for_server(
"example.com", ServerProtocol.TCP, SendToFileEventsOutputFormat.CEF, None
)
assert type(logger.handlers[0].formatter) == FileEventDictToCEFFormatter
assert isinstance(logger.handlers[0].formatter, FileEventDictToCEFFormatter)


def test_get_logger_for_server_when_given_json_format_uses_json_formatter():
logger = get_logger_for_server(
"example.com", ServerProtocol.TCP, OutputFormat.JSON, None
)
actual = type(logger.handlers[0].formatter)
assert actual == FileEventDictToJSONFormatter
assert isinstance(logger.handlers[0].formatter, FileEventDictToJSONFormatter)


def test_get_logger_for_server_when_given_raw_json_format_uses_raw_json_formatter():
logger = get_logger_for_server(
"example.com", ServerProtocol.TCP, OutputFormat.RAW, None
)
actual = type(logger.handlers[0].formatter)
assert actual == FileEventDictToRawJSONFormatter
assert isinstance(logger.handlers[0].formatter, FileEventDictToRawJSONFormatter)


def test_get_logger_for_server_when_called_twice_only_has_one_handler():
Expand All @@ -108,7 +106,7 @@ def test_get_logger_for_server_uses_no_priority_syslog_handler():
logger = get_logger_for_server(
"example.com", ServerProtocol.TCP, SendToFileEventsOutputFormat.CEF, None
)
assert type(logger.handlers[0]) == NoPrioritySysLogHandler
assert isinstance(logger.handlers[0], NoPrioritySysLogHandler)


def test_get_logger_for_server_constructs_handler_with_expected_args(
Expand Down
3 changes: 2 additions & 1 deletion 3 tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{311,310,39,38,37}
py{312,311,310,39,38,37}
docs
style
skip_missing_interpreters = true
Expand All @@ -12,6 +12,7 @@ deps =
pytest-cov == 4.0.0
pandas >= 1.1.3
pexpect == 4.8.0
setuptools >= 66.0.0

commands =
# -v: verbose
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.