mirror of
https://github.com/mvt-project/mvt.git
synced 2026-07-09 14:38:09 +02:00
Added more date conversion wrappers
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
# Use of this software is governed by the MVT License 1.1 that can be found at
|
||||
# https://license.mvt.re/1.1/
|
||||
|
||||
from mvt.common.utils import convert_mactime_to_iso, convert_unix_to_iso
|
||||
from mvt.common.utils import (convert_datetime_to_iso, convert_mactime_to_iso,
|
||||
convert_unix_to_iso,
|
||||
convert_unix_to_utc_datetime)
|
||||
|
||||
TEST_DATE_EPOCH = 1626566400
|
||||
TEST_DATE_ISO = "2021-07-18 00:00:00.000000"
|
||||
@@ -17,3 +19,13 @@ class TestDateConversions:
|
||||
|
||||
def test_convert_mactime_to_iso(self):
|
||||
assert convert_mactime_to_iso(TEST_DATE_MAC) == TEST_DATE_ISO
|
||||
|
||||
def test_convert_unix_to_utc_datetime(self):
|
||||
converted = convert_unix_to_utc_datetime(TEST_DATE_EPOCH)
|
||||
assert converted.year == 2021
|
||||
assert converted.month == 7
|
||||
assert converted.day == 18
|
||||
|
||||
def test_convert_datetime_to_iso(self):
|
||||
converted = convert_unix_to_utc_datetime(TEST_DATE_EPOCH)
|
||||
assert convert_datetime_to_iso(converted) == TEST_DATE_ISO
|
||||
|
||||
@@ -10,6 +10,7 @@ from mvt.common.indicators import Indicators
|
||||
|
||||
|
||||
class TestIndicators:
|
||||
|
||||
def test_parse_stix2(self, indicator_file):
|
||||
ind = Indicators(log=logging)
|
||||
ind.load_indicators_files([indicator_file], load_default=False)
|
||||
|
||||
Reference in New Issue
Block a user