def test_from_string(example_datetime: datetime.datetime):
    example_datetime = example_datetime.replace(tzinfo=None, microsecond=0)
    year = example_datetime.year
    month = example_datetime.month
    day = example_datetime.day
    hour = example_datetime.hour
    minute = example_datetime.minute
    second = example_datetime.second
    input_string = f'{year:04d}{month:02d}{day:02d}{hour:02d}{minute:02d}{second:02d}'
    time = MissionTime.from_string(input_string)
    assert isinstance(time, MissionTime)
    assert time.year == year
    assert time.month == month
    assert time.day == day
    assert time.hour == hour
    assert time.minute == minute
    assert time.second == second
    assert isinstance(time.mission_start_time, int)
    assert example_datetime == time.datetime
def test_apply_to_miz(test_file, example_datetime):
    result_miz = './test.miz'
    example_datetime = example_datetime.replace(tzinfo=None, microsecond=0)
    if example_datetime.day == 31:
        example_datetime = example_datetime.replace(day=30)
    year = example_datetime.year
    month = example_datetime.month
    day = example_datetime.day
    hour = example_datetime.hour
    minute = example_datetime.minute
    second = example_datetime.second
    input_string = f'{year:04d}{month:02d}{day:02d}{hour:02d}{minute:02d}{second:02d}'
    time = MissionTime.from_string(input_string)
    time.apply_to_miz(test_file, result_miz, overwrite=True)
    with Miz(result_miz) as miz:
        # original_start_time = miz.mission.mission_start_time
        # assert miz.mission.mission_start_time != original_start_time
        assert time.day == miz.mission.day
        assert time.month == miz.mission.month
        assert time.year == miz.mission.year
        assert time.mission_start_time == miz.mission.mission_start_time
def test_from_string_invalid_string(invalid_string):
    with pytest.raises(exc.InvalidDateTimeString):
        MissionTime.from_string(invalid_string)